def calc_area(points):
    
    #ref: http://en.wikipedia.org/wiki/Polygon
    
    if len(points) < 3: return 0

    p1 = points[0]
    a = 0
    for p2 in points[1:] + [points[0]]:       
        a += p1[X] * p2[Y] - p2[X] * p1[Y]
        p1 = p2
    a = 0.5 * a
    
    return a
Calculate the area of a polygon
dataset/ETHPy150Open estevaofon/angry-birds-python/pymunk-4.0.0/pymunk/util.py/calc_area