In scipy's ConvexHull, what does “area” measure?

馋奶兔 提交于 2019-12-30 05:56:09

问题


The value of the "area" attribute in scipy ConvexHull (see http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.ConvexHull.html) object does not seem to be (what I understand to be) the area of the convex hull. On the other hand, the value of "volume" does seem to be the area of the convex hull.

from scipy.spatial import ConvexHull
import numpy

points = numpy.array([[-1,-1], [1,1], [-1, 1], [1,-1]])
hull = ConvexHull(points)

print("Volume is %2.2f" % hull.volume) # Prints 4.00
print("Area is %2.2f" % hull.area) # Prints 8.00

In the above example, I expect the area of the convex hull of the 4 points to be 4.0. That's what the "volume" is. What then does "area" give us?


回答1:


Volume and area are 3d concepts, but your data is 2d - a 2x2 square. Its area is 4, and perimeter is 8 (the 2d counterparts).



来源:https://stackoverflow.com/questions/35664675/in-scipys-convexhull-what-does-area-measure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!