Line2

data class Line2(val direction: Vec2, val originOffSet: Double, val precision: DoubleEquivalence = DEFAULT_DOUBLE_EQUIVALENCE) : Line<Vec2> (source)

Represents a line in 2D space defined by a direction vector and an offset from the origin.

Constructors

Link copied to clipboard
constructor(direction: Vec2, originOffSet: Double, precision: DoubleEquivalence = DEFAULT_DOUBLE_EQUIVALENCE)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The direction of the line, which must be a unit vector.

Link copied to clipboard

The offset of the line from the origin.

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: Vec2): Boolean

Check if a point is on this line.

Link copied to clipboard
open override fun distance(vec: Vec2): Double

Get the distance from a point to this line.

Link copied to clipboard
open override fun location(vec: Vec2): Location

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

Link copied to clipboard
open override fun offset(vec: Vec2): Double

Get the offset of a point from this line.

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

Reverse the direction of this line.