Line3D

@Serializable
data class Line3D(val origin: Vector3, val direction: Vector3) : LinearType<Line3D> , GeometricPrimitive3D(source)

Represents a 3-dimensional line defined by an origin point and a direction vector.

A Line3D describes an infinite line in 3D space that extends through the origin in the direction specified by the direction vector. The line may be manipulated through arithmetic operations such as addition, subtraction, scaling, and division.

Constructors

Link copied to clipboard
constructor(origin: Vector3, direction: Vector3)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The direction vector of the line, which represents the orientation of the line in 3D space. Should ideally be normalized for consistency.

Link copied to clipboard

Provides a normalized representation of the line.

Link copied to clipboard

The starting point of the line.

Functions

Link copied to clipboard
open operator override fun div(scale: Double): Line3D
Link copied to clipboard
open operator override fun minus(right: Line3D): Line3D
Link copied to clipboard
open operator override fun plus(right: Line3D): Line3D
Link copied to clipboard

Calculates a position on the line at a given parameter t. The position is determined by extending or retracting the line along its direction vector by t units from the origin.

Link copied to clipboard

Creates a line segment between two positions on the line, determined by the parameters t0 and t1.

Link copied to clipboard
open operator override fun times(scale: Double): Line3D