I was searching for methods on how to calculate the area of a polygon and stubled across this: http://www.mathopenref.com/coordpolygonarea.html. $$ \mathop{area} = \left\lvert\frac{(x_1y_2 − y_1x_2) + (x_2y_3 − y_2x_3) + \cdots + (x_ny_1 − y_nx_1)}{2} \right\rvert $$ where $x_1,\ldots,x_n$ are the $x$-coordinates and $y_1,\ldots,y_n$ are the $y$-coordinates of the vertices. It does work and all, yet I do not fully understand why this works.
As far as I can tell you take the area of each triangle between two points. Basically you reapeat the formula of $\frac{1}{2} * h * w$ for each of the triangles and take the sum of them? Yet doesn't this leave a "square" in te center of the polygon that is not taken into account? (Apparently not since the correct answer is produced yet I cannot understand how).
If someone could explain this some more to me I would be grateful.