@jossmac/lil-libs
    Preparing search index...

    Function lerp

    • Linear interpolation between two values.

      • from: number

        Value at interpolation factor 0.

      • to: number

        Value at interpolation factor 1.

      • value: number

        Interpolation factor; typically in 0..1 but not clamped.

      from * (1 - value) + to * value, which is exact at value 0 and 1.

      lerp(0, 100, 0.25); // 25
      lerp(0, 100, 1.5); // 150 (not clamped; extrapolates beyond 0..1)