1List the vertices $(x_1,y_1), (x_2,y_2), \dots, (x_n,y_n)$ in order around the polygon, and treat $(x_{n+1}, y_{n+1}) = (x_1, y_1)$ to close the loop.
2Each term $\tfrac12(x_i y_{i+1} - x_{i+1} y_i)$ is the signed area of the triangle formed by the origin and edge $i$ — it is the cross product $\tfrac12(\vec{P_i}\times\vec{P_{i+1}})$.
3Summing these signed triangle areas, the contributions outside the polygon cancel and the inside is counted once, giving the polygon's signed area.
4The sign depends on orientation (counterclockwise is positive), so take the absolute value to get the geometric area.