Atom

math.lerp()

Computes a weighted interpolation.

Signature

math.lerp(a, b, t)

Parameters

Three numbers.

Returns

f64.

Behavior

Uses a * (1 - t) + b * t. Allows extrapolation.

Errors

Requires numeric operands.

Example

Atom
use math
assert(math.lerp(2, 6, 0.25) == 3)