Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
area of a convex polygon solution in Clear category for Area of a Convex Polygon by Nirmala
def checkio(data):
n = 1
p = 0
x = 0
while n <= len(data):
if (x+1) < len(data):
i = (data[x][0] + data[x+1][0]) * (data[x + 1][1] - data[x][1])
p += i
x += 1
n += 1
else:
i = (data[x][0] + data[0][0]) * (data[0][1] - data[x][1])
p += i
n += 1
return abs(p/2)
Jan. 5, 2017