RPE Chart Utils
    Preparing search index...

    Function cubicBezier

    • Create a cubic bezier easing function from two control points. Equivalent to CSS cubic-bezier(x1, y1, x2, y2).

      The start point is always (0, 0) and the end point is always (1, 1); only the two inner control points are specified.

      Parameters

      • x1: number

        X of the first control point (should be in [0, 1]).

      • y1: number

        Y of the first control point.

      • x2: number

        X of the second control point (should be in [0, 1]).

      • y2: number

        Y of the second control point.

      Returns (t: number) => number

      A function mapping progress x ∈ [0, 1] → eased value.

      // Equivalent to CSS ease-in-out
      const ease = cubicBezier(0.42, 0, 0.58, 1);
      ease(0.5); // ~0.5 (symmetric curve)

      // Material Design standard curve
      const standard = cubicBezier(0.4, 0.0, 0.2, 1.0);