Class CubicBezier
- Namespace
- Bindables
- Assembly
- Bindables.dll
Provides cubic Bezier curve evaluation for easing functions.
public static class CubicBezier
- Inheritance
-
CubicBezier
- Inherited Members
Remarks
This class implements cubic Bezier curves commonly used in CSS animations and easing functions. The curve is defined by two control points (x1, y1) and (x2, y2), with implicit start point (0, 0) and end point (1, 1).
Methods
Evaluate(float, float, float, float, float)
Evaluates the cubic Bezier curve at the given time parameter.
public static float Evaluate(float t, float x1, float y1, float x2, float y2)
Parameters
tfloatThe time parameter in the range [0, 1].
x1floatThe x-coordinate of the first control point.
y1floatThe y-coordinate of the first control point.
x2floatThe x-coordinate of the second control point.
y2floatThe y-coordinate of the second control point.
Returns
- float
The y-value of the curve at the given time parameter.
Remarks
The curve is evaluated by first solving for the u parameter that corresponds to the given t value on the x-axis, then sampling the curve at that u parameter to get the y-value. If x1 equals y1 and x2 equals y2, the function returns a linear interpolation.