intersects

infix fun Line.intersects(segment: Segment): Boolean

Line intersects Segment => Boolean
Returns whether the line touches or crosses the segment.

Segment intersects Line with the operands swapped — the identical rounded decision.

Receiver

The line to test.

Return

true when the rounded straddle test passes.

Parameters

segment

The segment tested against.


infix fun Line.intersects(polygon: Polygon): Boolean

Line intersects Polygon => Boolean
Returns whether the line reaches the polygon's solid region.

Polygon intersects Line with the operands swapped — the identical rounded decision, orientation-awareness included.

Receiver

The line to test.

Return

true when polygon is inside-out, or any edge touches or crosses the line.

Parameters

polygon

The polygon tested against.


infix fun Segment.intersects(line: Line): Boolean

Segment intersects Line => Boolean
Returns whether the line touches or crosses the segment.

A straddle test: the segment's endpoints must not lie strictly on one side of the line — the two signed distances, each rounded at the SCALE quantum, must not multiply to a positive value. Touching counts: an endpoint within the quantum of the line rounds to zero, and a collinear segment intersects along its whole length.

Receiver

The segment to test.

Return

true when the rounded straddle test passes.

Parameters

line

The line tested against.


infix fun Segment.intersects(other: Segment): Boolean

Segment intersects Segment => Boolean
Returns whether the segments touch, cross, or overlap, endpoints included.

True when the segments share at least one point, every gate rounded at the SCALE quantum — touching within the quantum counts. Collinear segments intersect when they overlap along the shared carrier.

Receiver

The first segment.

Return

true when the segments share at least one point.

Parameters

other

The second segment.


infix fun Segment.intersects(polygon: Polygon): Boolean

Segment intersects Polygon => Boolean
Returns whether the segment touches the polygon's boundary or lies within its solid region.

True when the segment and the closed solid region share at least one point, every gate rounded at the SCALE quantum: contact with any edge, or the segment entirely within. The polygon's orientation decides its solid side — a classic polygon fills its loop, an inside-out one (Polygon.isInsideOut) the closed complement.

Receiver

The segment to test.

Return

true when the segment and the solid region share at least one point.

Parameters

polygon

The polygon tested against.


infix fun Polygon.intersects(line: Line): Boolean

Polygon intersects Line => Boolean
Returns whether the line reaches the polygon's solid region.

For a classic polygon, true when the line and the closed region share at least one point — necessarily on the boundary, since an infinite line cannot lie inside a bounded region; rounded at the SCALE quantum. An inside-out polygon (Polygon.isInsideOut) always intersects: its solid region is unbounded in every direction, and an infinite line always reaches it.

Receiver

The polygon to test.

Return

true when this polygon is inside-out, or any edge touches or crosses the line.

Parameters

line

The line tested against.


infix fun Polygon.intersects(segment: Segment): Boolean

Polygon intersects Segment => Boolean
Returns whether the segment touches the polygon's boundary or lies within its solid region.

Segment intersects Polygon with the operands swapped — the identical rounded decision, orientation-awareness included.

Receiver

The polygon tested against.

Return

true when the segment and the solid region share at least one point.

Parameters

segment

The segment to test.


infix fun Polygon.intersects(other: Polygon): Boolean

Polygon intersects Polygon => Boolean
Returns whether the two solid regions share any point — touching boundaries count.

True when the closed solid regions overlap in any way, every gate rounded at the SCALE quantum: crossing or touching boundaries, or one solid region entirely within the other. Each operand's orientation decides its solid side — a classic polygon fills its loop, an inside-out one (Polygon.isInsideOut) the closed complement. Two inside-out polygons always intersect: both solid regions are unbounded, and far enough out every direction belongs to both.

Receiver

The first polygon.

Return

true when the solid regions share at least one point.

Parameters

other

The second polygon.