Struct Easing.PolynomialEasing
Represents a 3rd- or 4th-degree polynomial easing function for animation timing curves.
public readonly struct Easing.PolynomialEasing
- Inherited Members
Remarks
This type can be used to approximate Bézier-based easing curves (like Easing.CubicBezier) using polynomial coefficients, which are faster to evaluate and easier to store or serialize.
Constructors
PolynomialEasing(NFloat, NFloat, NFloat, NFloat)
Constructs a 3rd-degree polynomial: y = B·x³ + C·x² + D·x + E
public PolynomialEasing(NFloat b, NFloat c, NFloat d, NFloat e)
Parameters
PolynomialEasing(NFloat, NFloat, NFloat, NFloat, NFloat)
Constructs a 4th-degree polynomial: y = A·x⁴ + B·x³ + C·x² + D·x + E
public PolynomialEasing(NFloat a, NFloat b, NFloat c, NFloat d, NFloat e)
Parameters
PolynomialEasing(CubicBezier, int)
Approximates a Easing.CubicBezier easing curve using a cubic polynomial. The result fits y = B·x³ + C·x² + D·x + E over the domain x ∈ [0, 1].
public PolynomialEasing(Easing.CubicBezier bezier, int samples = 16)
Parameters
bezier
Easing.CubicBezierThe Bézier curve to approximate.
samples
intNumber of sample points to use in least-squares fitting. Default is 16.
Fields
A
The coefficient for x⁴ (A = 0 for cubic curves).
public readonly NFloat A
Field Value
B
The coefficient for x³.
public readonly NFloat B
Field Value
C
The coefficient for x².
public readonly NFloat C
Field Value
D
The coefficient for x¹.
public readonly NFloat D
Field Value
E
The constant term.
public readonly NFloat E
Field Value
Properties
this[NFloat]
Evaluates the polynomial at a given value of x ∈ [0, 1].
public NFloat this[NFloat x] { get; }
Parameters
x
NFloatThe input value (typically time).
Property Value
- NFloat
The eased value at x.