Calculating an area of a polygon