# Area of an irregular $n$-gon

Given the coordinates for the vertices of an irregular polygon, is there a formula to calculate its area?

For example, if the coordinates given are $(0,0), (0,5), (1,5), (1,1), (5,1), (5,0)$ then the area is $9$. Is there a formula which takes in arbitrary vertices and spits out their area?

You want the shoelace formula: if a polygon has vertices $(x_1,y_1),\dots,(x_n,y_n)$, then its (signed) area is given by $$\frac{1}{2}\sum_{i=1}^n (x_i y_{i+1}-x_{i+1}y_i)$$ where all index arithmetic is performed modulo $n$.