在scipy的ConvexHull中,"区域"的衡量标准是什么?

mja*_*ews 15 python scipy convex-hull

scipy ConvexHull(参见http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.ConvexHull.html)对象中的"area"属性的值似乎不是(我理解为be)凸壳的面积.另一方面,"体积"的值似乎确实是凸包的面积.

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
Run Code Online (Sandbox Code Playgroud)

在上面的例子中,我预计4点凸壳的面积为4.0.那就是"音量".那么"地区"给了我们什么?

hpa*_*ulj 15

体积和面积是3d概念,但您的数据是2d - 2x2平方.它的面积是4,周长是8(第2对应的).

  • 上帝该死我只花了2天调查我项目中的其他所有内容,然后终于质疑`area`实际上是一个区域......非常感谢你的回答. (3认同)