Finding the area of a simple polygon
Finding the area of a simple polygon
Let a simple polygon (without self-intersections, but not necessarily convex) be given, specified by the coordinates of its vertices in traversal order clockwise or counterclockwise. It is required to find its area.
Method 1
You can iterate over all edges and sum the areas of the trapezoids bounded by each edge. The area must be taken with a sign (it is precisely thanks to the sign that all the “extra” area will cancel out).
Formula for one edge :