1
$\begingroup$

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?

$\endgroup$
4
$\begingroup$

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$.

$\endgroup$
1
$\begingroup$

You might want to check out Pick's theorem. It's not exactly what you described, but you should be able to use it to construct some sort of program which takes the vertices as input and outputs the area.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.