Section2

data class Section2<T : Number, Comparable<T>>(val start: <Error class: unknown class><T>, val end: <Error class: unknown class><T>)

2D line section with given start and end points.

Since

v2.0.0

Constructors

Link copied to clipboard
constructor(start: <Error class: unknown class><T>, end: <Error class: unknown class><T>)

Functions

Link copied to clipboard
operator fun contains(point: <Error class: unknown class><T>): Boolean

Returns true if given point is on this section.

Link copied to clipboard
fun distanceTo(point: <Error class: unknown class><T>): T

Returns distance between this section and given point to this section.

Link copied to clipboard
fun intersectionWith(other: Section2<T>): <Error class: unknown class><T>?

Calculates intersection point of this section and given other section.

Link copied to clipboard
fun projectionOf(point: <Error class: unknown class><T>): <Error class: unknown class><T>

Returns projection of given point onto this section.

Properties

Link copied to clipboard
val asVector: <Error class: unknown class><T>

This section as a vector from start point to end point.

Link copied to clipboard

Bounding box of this section.

Link copied to clipboard
val direction: <Error class: unknown class><T>

Direction unit vector for this section.

Link copied to clipboard
val end: <Error class: unknown class><T>

End point of this section.

Link copied to clipboard
val length: T

Length of this section.

Link copied to clipboard
val start: <Error class: unknown class><T>

Start point of this section.