Open this example in the interactive library
Source code
const lerp = (a, b, t) => a + (b - a) * t;
console.log(lerp(10, 30, 0.25));
Sample output
15

Interpolate a value. A self-contained example using the JavaScript runtime.
Open this example in the interactive library
const lerp = (a, b, t) => a + (b - a) * t;
console.log(lerp(10, 30, 0.25));
15