Shoelace formula (source code)

= Shoelace formula

For a simple <polygon> with cyclically ordered <vertices of a polygon> $(x_i,y_i)$, its signed area is $\tfrac12\sum_i(x_i y_{i+1}-x_{i+1}y_i)$, with indices read cyclically. Reversing the traversal changes the sign; taking the absolute value gives the area. Each summand is a two-dimensional <determinant>.