# Quick and easy way to calculate the area of any polygon — the shoelace formula

In my spare time, I enjoy watching a number of math channels on youtube, such as Numberphile, PBS infinite series,  and standupmaths.  Typically, most of the videos are about number theory or prime numbers and are not very useful to a mechanical engineer.  However, this video from mathologer discusses the shoelace formula for calculating the area of a polygon, which an engineer may find useful for calculating the area of a fluid channel or a beam section (see also the wikipedia entry for the shoelace formula).  It works for any polygon that does not intersect itself.  It may be useful in doing quick hand calculations, and it is easily scripted into a function for a computer to calculate.  One could also make a straight line approximation of a shape with curved lines to estimate its area.

The shoelace formula gets its name from the arrangement of the coordinates and how they are combined to calculate the area.  Arrange the x-y coordinates of the polygon in a (n+1)x2 matrix where the order is determined by a counterclockwise pattern around the perimeter and the starting point is also repeated as the last row in the matrix.

Again, notice that the order is counterclockwise and that the first point is repeated in the last line of the matrix (there are n+1 rows if the polygon has n points).

To calculate the area, we add when multiplying down and to the right and subtract pairs when multiplying down and to the left.  That is

In the example polygon shown above, we have

Performing the calculation, we obtain