Flocc
    Preparing search index...

    Function lerp

    • Linearly interpolates between x and y. The third parameter t (usually a value between 0 and 1) is the amount by which to interpolate — a value of 0 returns the x value and 1 returns the y value.

      lerp(5, 10, 0.5); // returns 7.5
      lerp(0, 100, 0.1); // returns 10
      lerp(22, 79, 1); // returns 79

      Parameters

      • x: number

        The first value.

      • y: number

        The second value.

      • t: number

        The amount by which to interpolate (0 returns x, 1 returns y).

      Returns number

      0.2.4