Linear interpolation

aka lerp

Fast (imprecise) lerp function

function lerpFast(a, b, t) {
    return a + (b - a) * t
}

This variant is susceptible to floating-point error, for example:

lerpFast(0.4, 0.1, 1)
/* returns 0.09999999999999998 instead of 0.1 */

Standard (precise) lerp function

function lerp(a, b, t) {
    return a * (1 - t) + b * t
}