12
scipy ConvexHull(请参阅http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.ConvexHull.html)对象中的“area”属性的值似乎不是(我所理解的)凸包的面积。另一方面,“体积”的值似乎是凸包的面积。在scipy的ConvexHull中,“area”是什么措施?
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
在上面的例子中,我预计4点的凸包的面积为4.0。这就是“音量”。那么“区域”给我们什么呢?
这很有道理。 – mjandrews
God dammit我只花了2天时间调试了我的项目中的所有其他内容,然后才终于质疑'area'实际上是一个区域......非常感谢您的回答。 – max