Segment

interface Segment<V : Vector<V>>(source)

Represents a geometric segment defined by a start and an endpoint.

Parameters

V

The type of vector representing the start and end points of the segment.

Inheritors

Properties

Link copied to clipboard
abstract val end: V

Returns the end point of the segment.

Link copied to clipboard
abstract val start: V

Returns the start point of the segment.

Functions

Link copied to clipboard
abstract fun intersection(other: Segment<V>, equivalence: DoubleEquivalence = DEFAULT_DOUBLE_EQUIVALENCE): IntersectionData<V>

Compute the intersection of this segment with another segment.

Link copied to clipboard
abstract fun length(): Double

Get the length of the segment.

Link copied to clipboard
abstract fun reverse(): Segment<V>

Reverses the segment, swapping its start and end points.

Link copied to clipboard
abstract fun transform(transformer: Transformer<V>): Segment<V>

Applies a transformation to the endpoints of this segment.