unaryMinus

operator fun <T : Segment> T.unaryMinus(): T

-Segment => Segment
Returns this segment with its endpoints exchanged — the same chord, opposite orientation.

Re-wedges Segment.end with Segment.start, negating the wrapped blade — the wedge of two points flips sign with their order — so the negation agrees with the dipole's: (-segment).toDipole == -(segment.toDipole). The endpoint instances are kept, exchanged; a segment at infinity has no endpoints to exchange and negates the wrapped blade directly, raw components as data. Identity is orientation-sensitive, so a segment and its negation compare unequal; compare Segment.canonical for unoriented equivalence. The result is the receiver's own class: the reversed geometry returns through Segment.copy, preserving a subclass that overrides the hook.

Receiver

The Segment to reverse.

Return

The reversed segment, as the receiver's class.

Type Parameters

T

The receiver's type, preserved in the result.


operator fun <T : Polyline> T.unaryMinus(): T

-Polyline => Polyline
Returns this chain walked in reverse — the same edges traversed from the other end.

Reverses the vertex order: the first vertex becomes the last and every edge flips its running direction. The vertex instances are kept — only the traversal direction changes — and reversing twice restores the original vertex list exactly. Identity is traversal-sensitive, so a chain and its reversal compare unequal (a palindromic chain being its own reversal). The result is the receiver's own class: the reversed geometry returns through Polyline.copy, preserving a subclass that overrides the hook.

Receiver

The Polyline to reverse.

Return

The reversed polyline, as the receiver's class.

Type Parameters

T

The receiver's type, preserved in the result.


operator fun <T : Polygon> T.unaryMinus(): T

-Polygon => Polygon
Returns this polygon turned inside out — the same loop walked in reverse.

Reverses the vertex order, flipping the winding and the sign of Polygon.signedArea: a classic loop comes back inside out and vice versa (Polygon.isInsideOut flips), so its solid region is the complement of this polygon's. The vertex instances are kept — only the traversal direction changes — and reversing twice restores the original vertex list exactly. Identity is traversal-sensitive, so a polygon and its reversal compare unequal. The result is the receiver's own class: the reversed geometry returns through Polygon.copy, preserving a subclass that overrides the hook.

Receiver

The Polygon to turn inside out.

Return

The reversed polygon, as the receiver's class.

Type Parameters

T

The receiver's type, preserved in the result.