Function lerp

  • Linear interpolation between 2 values

    Example

    // Returns a
    lerp(a,b,0)

    // Returns b
    lerp(a,b,1)

    // Returns 5
    lerp(0,10,0.5)

    // Returns 2.5
    lerp(0,10,0.25)

    // Returns 10
    lerp(5,15,0.5)

    Parameters

    • a: number

      The starting value

    • b: number

      The ending value

    • t: number

      The amount to interpolate

    Returns number

Generated using TypeDoc