Why it matters

Shoelace is fundamental polygon formula. Understanding shapes basics.

Advertisement

The architecture

Area = 0.5 * |sum of (x_i * y_{i+1} - x_{i+1} * y_i)|.

Signed area indicates orientation.

Shoelace formulaVerticesin orderCross productssigned contributionsSum + half|A| for areaSigned area: positive CCW, negative CW; useful for orientation tests
Shoelace.
Advertisement

How it works end to end

O(n).

Signed: CCW positive.

Works for simple polygons.