ps1
    Preparing search index...

    Function interpolate

    • Perform interpolation of scalars with an easing function. The easing function transforms linear change into change that may accelerate, oscillate, etc., and that may not be bounded or endpointed by v0 and v1.

      For example:

      interpolate(0, 1, t => t*t, 0.6) = 0.36
      interpolate(0, 10, t => t*Math.cos(2*Math.PI*t), 0.4) ≈ -3.236
      

      Parameters

      • v0: number

        value when easing(t) = 0

      • v1: number

        value when easing(t) = 1

      • easing: (ti: number) => number

        function mapping input interpolation parameter ti, 0 <= ti <= 1, to an applied interpolation parameter, unconstrained

      • t: number

        input interpolation parameter

      Returns number

      the linear interpolation along v0 to v1 at easing(t)

      Error if t < 0 or t > 1