Class: Line

Line(origin, direction)

Represents a line in Cartesian coordinates.

Constructor

new Line(origin, direction)

Constructs a line from a specified origin and direction.
Parameters:
Name Type Description
origin Vec3 The line's origin.
direction Vec3 The line's direction.
Source:
Throws:
If either the origin or the direction are null or undefined.
Type
ArgumentError

Members

direction :Vec3

This line's direction.
Type:
Source:

origin :Vec3

This line's origin.
Type:
Source:

Methods

(static) fromSegment(pointA, pointB) → {Line}

Creates a line given two specified endpoints.
Parameters:
Name Type Description
pointA Vec3 The first endpoint.
pointB Vec3 The second endpoint.
Source:
Throws:
If either endpoint is null or undefined.
Type
ArgumentError
Returns:
The new line.
Type
Line

pointAt(distance, result) → {Vec3}

Computes a Cartesian point a specified distance along this line.
Parameters:
Name Type Description
distance Number The distance from this line's origin at which to compute the point.
result Vec3 A pre-allocated Vec3 instance in which to return the computed point.
Source:
Throws:
If the specified result argument is null or undefined.
Type
ArgumentError
Returns:
The specified result argument containing the computed point.
Type
Vec3