@sensimods/utility-lab
    Preparing search index...

    Function lerp

    • Performs linear interpolation between two numbers. Calculates a value between 'start' and 'end' based on the 'amount' (percentage).

      Parameters

      • start: number

        The starting number.

      • end: number

        The ending number.

      • amount: number

        The interpolation multiplier (typically between 0.0 and 1.0).

      Returns number

      The interpolated value.

      lerp(0, 100, 0.5) // 50 (50% of the way between 0 and 100)
      lerp(20, 80, 0.25) // 35 (25% of the way between 20 and 80)