polygon2.signedArea

The signed area: positive for a counter-clockwise ring, negative for clockwise (y up).

Value helperSince 0.4.0

Usage

TypeScript
polygon.signedArea(): number

Returns

Area in model units squared with the winding’s sign; 0 for a collinear ring; for a self-intersecting ring the lobes’ signed areas add (a bow-tie gives 0).

Example

TypeScript
Polygon2.rectangle(2, 2).value.reversed().signedArea() // → -4

See also