meo-canvas - v8.1.5
    Preparing search index...

    Function cubicBezier

    • Builds the CSS cubic-bezier(x1, y1, x2, y2) curve.

      The curve is parametric, so drawing it at a given time means first finding the parameter whose x equals that time. Newton's method converges in a few steps for well-behaved curves; a bisection fallback covers the steep ones, where the derivative approaches zero and Newton stalls.

      Parameters

      • x1: number
      • y1: number
      • x2: number
      • y2: number

      Returns EasingFn

      const easeInOut = cubicBezier(0.42, 0, 0.58, 1) // the CSS ease-in-out curve