@sstorsveen/maths - v2.0.1
    Preparing search index...

    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: Vec4

        the first start value - a 4-element vector object

      • b1: Vec4

        the first end value - a 4-element vector object

      • a2: Vec4

        the second start value - a 4-element vector object

      • b2: Vec4

        the second end value - a 4-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: Vec4

        a 4-element vector in which to store the result

      • Optionaltmp: Vec4

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

      Returns Vec4

      c - the interpolation result