Toolkit 55

Shoelace Theorem

Polygon with vertices A_1 through A_n

The vertices should be written in clockwise or counterclockwise order:

A1(x1,y1), A2(x2,y2), , An(xn,yn)A_1(x_1,y_1),\ A_2(x_2,y_2),\ \ldots,\ A_n(x_n,y_n)

The area of the polygon is:

Area=12x1y2+x2y3++xn1yn+xny1y1x2y2x3yn1xnynx1\text{Area}=\tfrac{1}{2}\bigl|x_1y_2+x_2y_3+\cdots+x_{n-1}y_n+x_ny_1-y_1x_2-y_2x_3-\cdots-y_{n-1}x_n-y_nx_1\bigr|