lerp

fun lerp(p: Double, q: Double, time: Double): Double(source)

Computes the linear interpolation of two values.

const n = Math.lerp(0.0, 2.0, 0.5); // returns 1.0

Return

The linearly interpolated value.

Parameters

p

The start value to interpolate.

q

The end value to interpolate.

time

The time of interpolation generally in the range [0.0, 1.0].

See also