Difference between convhull() and convhulln()?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
In MATLAB's function libraries, there are 2 functions that achieve descriptively the same purpose: 1) convhull() 2) convhulln()
I notice that these 2, when applied to the same set of input, gives me slightly different answers for volume (negligible error, but I am confused why there is a difference since I thought the algorithm gives an EXACT volume). And for some sets of vertices, convhulln() outputs an error while convhull() works.
Can someone explain to me the difference between the two?
0 comentarios
Respuestas (3)
Walter Roberson
el 11 de Jul. de 2015
convhulln can operate in higher dimensional spaces.
Negligible error would be due to floating point roundoff, probably.
0 comentarios
Image Analyst
el 11 de Jul. de 2015
convhull() operates on 2D data - points in an infinitely thin plane. How are you computing the volume from that? It won't have a volume. Or a volume of zero.
convhulln operates on higher dimensional data. In 3D it would be like putting a tight balloon around your points. It would return the points that are "pointy" in your balloon envelope. How do you compute the volume from that?
John D'Errico
el 12 de Jul. de 2015
Welcome to the wonderful, wacky world of floating point arithmetic.
There is no such thing as an "exact" computation when done in floating point arithmetic by two distinct code sequences. That you get subtly (though negligibly) different results when two different computations are applied is no surprise at all. Many such mathematically, theoretically identical operations, when implemented in floating point arithmetic, will fail to yield numerically identical results.
0 comentarios
Ver también
Categorías
Más información sobre Bounding Regions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!