Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- points = ((1, 2), (3, 4), (5, 4))
- area = 0.0
- for i, j in zip(points[:-1], points[1:]):
- area += (j[0] - i[0]) * (i[1] + j[1]) / 2.0
- width = points[-1][0] - points[0][0]
- average = area / width
- print average
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement