polygon2.reversed

The same ring wound the other way.

Value helperSince 0.4.0

Usage

TypeScript
polygon.reversed(): Polygon2

Returns

A new polygon with the corners in reverse order; signedArea() changes sign.

Example

TypeScript
Polygon2.rectangle(2, 2).value.reversed().isCounterClockwise() // → false

See also