Function lerpE

  • Element-wise linear interpolation between a and b based on tx and ty, where tx and ty are numbers between 0.0 and 1.0. The result is stored in c.

    The calculation is as follows: a.x and b.x are interpolated based on tx to give c.x, a.y and b.y are interpolated based on ty to give c.y.

    The result will be equal to a when tx and ty are both 0.0, equal to b when tx and ty are both 1.0, and halfway between a and b when tx and ty are both 0.5

    Parameters

    • a: Vec2

      the start x and y values - a 2-element vector object

    • b: Vec2

      the end x and y values - a 2-element vector object

    • tx: number

      a floating point number in the interval [0.0, 1.0]

    • ty: number

      a floating point number in the interval [0.0, 1.0]

    • c: Vec2

      a 2-element vector in which to store the result

    Returns Vec2

    c - the interpolation result

Generated using TypeDoc