Line3

data class Line3(val direction: Vec3, val moment: Vec3, val precision: DoubleEquivalence = DEFAULT_DOUBLE_EQUIVALENCE) : Line<Vector3<*>> (source)

Represents a line in 3D space defined by a direction vector and a moment (point offset).

The line is stored in Plücker form using a unit direction vector and a moment vector computed as point × direction for any point on the line. This representation allows stable distance and side classification while remaining translation invariant.

Constructors

Link copied to clipboard
constructor(direction: Vec3, moment: Vec3, precision: DoubleEquivalence = DEFAULT_DOUBLE_EQUIVALENCE)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The unit direction vector of the line.

Link copied to clipboard

The moment vector (point × direction) identifying the line's position.

Link copied to clipboard

The precision used for geometric computations, defaulting to DEFAULT_DOUBLE_EQUIVALENCE.

Functions

Link copied to clipboard
open operator fun contains(vec: Vector3<*>): Boolean

Check if a point is on this line.

Link copied to clipboard
open infix override fun distance(other: Vector3<*>): Double

Compute the distance to another point.

Link copied to clipboard
open override fun location(vec: Vector3<*>): Location

Determine the location of a point with respect to this line.

Link copied to clipboard
open override fun offset(vec: Vector3<*>): Double

Get the offset of a point from this line.

Link copied to clipboard
open override fun reverse(): Line3

Reverse the direction of this line.