在 scipy 的 ConvexHull 中,“区域"是指什么?措施? [英] In scipy's ConvexHull, what does "area" measure?

查看:98
本文介绍了在 scipy 的 ConvexHull 中,“区域"是指什么?措施?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

在上面的例子中,我期望 4 个点的凸包面积为 4.0.这就是音量".那么区域"给了我们什么?

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?

推荐答案

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

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).

这篇关于在 scipy 的 ConvexHull 中,“区域"是指什么?措施?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆