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对应的).
| 归档时间: |
|
| 查看次数: |
2060 次 |
| 最近记录: |