Table of Contents

Struct Easing.PolynomialEasing

Namespace
Xui.Core.Animation
Assembly
Core.dll

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

b NFloat
c NFloat
d NFloat
e NFloat

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

a NFloat
b NFloat
c NFloat
d NFloat
e NFloat

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.CubicBezier

The Bézier curve to approximate.

samples int

Number 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

NFloat

B

The coefficient for x³.

public readonly NFloat B

Field Value

NFloat

C

The coefficient for x².

public readonly NFloat C

Field Value

NFloat

D

The coefficient for x¹.

public readonly NFloat D

Field Value

NFloat

E

The constant term.

public readonly NFloat E

Field Value

NFloat

Properties

this[NFloat]

Evaluates the polynomial at a given value of x ∈ [0, 1].

public NFloat this[NFloat x] { get; }

Parameters

x NFloat

The input value (typically time).

Property Value

NFloat

The eased value at x.