line.pointAt

The point at a normalised parameter along a segment.

Value helperSince 0.3.0

Usage

TypeScript
Line.pointAt(l: Line, t: number): Point3

Parameters

  • lLine

    The segment. Required. In model.

  • tnumber

    0 gives from, 1 gives to; outside [0, 1] extrapolates along the line. Required. In normalised.

Returns

The point from + (to − from) · t; NaN when a coordinate is NaN or two infinities cancel.

Example

TypeScript
Line.pointAt(Line.of(Point3.origin, Point3.of(4, 0, 0)), 0.5) // → { x: 2, y: 0, z: 0 }

See also