Sunday, June 25, 2017

Area Of A Irregular Polygon By Points



function  Area_Of_A_Irregular_Polygon_By_Points(points, i=1) =
    let(
    area = (points [i-1].x+points[i].x) * (points[i-1].y-points[i].y))
    i<len(points)?
    area/2 +Area_Of_A_Irregular_Polygon_By_Points(points, i+1) 
    :(points [i-1].x+points[0].x) * (points[i-1].y-points[0].y)/2; 

No comments:

Post a Comment