Function lerp2

  • Bilinear interpolation between a1, b1, a2 and b2 based on s and t, where s and t are numbers between 0.0 and 1.0. The result is stored in c.

    The calculation is as follows: a1 and b1 are interpolated based on s to give p, a2 and b2 are interpolated based on s to give q, and then the final result is obtained by interpolating p and q based on t.

    The result will be equal to a1 when both s and t is 0.0, equal to a2 when s is 0.0 and t is 1.0, equal to b1 when s is 1.0 and t is 0.0, and equal to b2 when both s and t is 1.0

    Parameters

    • a1: Vec2

      the first start value - a 2-element vector object

    • b1: Vec2

      the first end value - a 2-element vector object

    • a2: Vec2

      the second start value - a 2-element vector object

    • b2: Vec2

      the second end value - a 2-element vector object

    • s: number

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

    • t: number

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

    • c: Vec2

      a 2-element vector in which to store the result

    • Optional tmp: Vec2

      an optional 2-element vector for temporary storage. If not provided, one will be created (and then discarded) internally

    Returns Vec2

    c - the interpolation result

Generated using TypeDoc