point3.lerp

The point at a normalised parameter along the segment from a to b.

Value helperSince 0.3.0

Usage

TypeScript
Point3.lerp(a: Point3, b: Point3, t: number): Point3

Parameters

  • aPoint3

    The point at t = 0. Required. In model.

  • bPoint3

    The point at t = 1. Required. In model.

  • tnumber

    Position along the segment: 0 gives a, 1 gives b; values outside [0, 1] extrapolate along the line. Required. In normalised.

Returns

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

Use instead

Example

TypeScript
Point3.lerp(Point3.origin, Point3.of(10, 0, 0), 0.25) // → { x: 2.5, y: 0, z: 0 }

See also