• Get a value linearly interpolated between two endpoints.

    Returns

    the value that is t% from a to b

    Example

    lerp(0, 4, 0) === 0
    

    Example

    lerp(0, 4, 0.5) === 2
    

    Example

    lerp(0, 4, 1) === 4
    

    Parameters

    • a: number

      the end point for the interpolation

    • b: number

      the start point for the interpolation

    • t: number

      the amount to interpolate. A value in the range 0<=t<=1

    Returns number

Generated using TypeDoc