/**
 * Linear interpolation between two values controlled by a given fraction.
 * Note: no clamping is done to the fraction value.
 * @param {number} a
 * @param {number} b
 * @param {number} fraction value between 0 and 1
 * @return {number}
 *
 * @example
 *    lerp(1, 2, 0.5) === 1.5
 *    lerp(1, 2, 0) === 1
 *    lerp(1, 2, 1) === 2
 */
export function lerp(a, b, fraction) {
    const span = b - a;
    return span * fraction + a;
}
