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 abs(area / 2)
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 abs(area / 2)