利用python计算多边形面积(鞋带公式)
作者:互联网
https://www.cnblogs.com/zzcpy/p/10524348.html
维基百科-鞋带公式:https://en.wikipedia.org/wiki/Shoelace_formula
def polygon_area(points):
"""返回多边形面积
"""
area = 0
q = points[-1]
for p in points:
area += p[0] * q[1] - p[1] * q[0]
q = p
return area / 2
最后记得绝对值一下
标签:多边形,鞋带,area,python,公式,points,https 来源: https://blog.csdn.net/diana_jiuri1314/article/details/116111038