Table of Contents

Struct QuadraticMotionCurve

Namespace
Xui.Core.Animation
Assembly
Core.dll

Represents a 1D motion curve under constant acceleration, defined as a quadratic function of time.

This curve is useful for modeling motion that decelerates smoothly to a stop, such as fling or scroll-stop animations.

public readonly struct QuadraticMotionCurve
Inherited Members

Constructors

QuadraticMotionCurve(TimeSpan, NFloat, NFloat, NFloat)

Constructs a curve from initial position, velocity, and acceleration magnitude. The acceleration is applied in the opposite direction of velocity to decelerate to zero.

public QuadraticMotionCurve(TimeSpan startTime, NFloat startPosition, NFloat startVelocity, NFloat accelerationMagnitude)

Parameters

startTime TimeSpan

The time when motion starts.

startPosition NFloat

Initial position.

startVelocity NFloat

Initial velocity (positive or negative).

accelerationMagnitude NFloat

Positive scalar magnitude of deceleration.

QuadraticMotionCurve(TimeSpan, TimeSpan, NFloat, NFloat, NFloat)

Initializes the curve with explicit polynomial coefficients and time range.

public QuadraticMotionCurve(TimeSpan startTime, TimeSpan endTime, NFloat a, NFloat b, NFloat c)

Parameters

startTime TimeSpan

The time when motion starts.

endTime TimeSpan

The time when motion ends.

a NFloat

The quadratic coefficient.

b NFloat

The linear coefficient.

c NFloat

The constant offset.

Fields

A

The quadratic coefficient (0.5 * acceleration).

public readonly NFloat A

Field Value

NFloat

B

The linear coefficient (initial velocity minus adjustment).

public readonly NFloat B

Field Value

NFloat

C

The constant coefficient (initial position minus offset).

public readonly NFloat C

Field Value

NFloat

EndTime

The time at which the motion ends (i.e., when velocity reaches zero).

public readonly TimeSpan EndTime

Field Value

TimeSpan

StartTime

The time at which the motion starts.

public readonly TimeSpan StartTime

Field Value

TimeSpan

Properties

FinalPosition

Gets the final position of the motion at EndTime.

public NFloat FinalPosition { get; }

Property Value

NFloat

this[TimeSpan]

Evaluates the position of the motion at the specified time.

public NFloat this[TimeSpan time] { get; }

Parameters

time TimeSpan

The time at which to evaluate the position.

Property Value

NFloat

Methods

VelocityAt(TimeSpan)

Evaluates the instantaneous velocity at the specified time.

public NFloat VelocityAt(TimeSpan time)

Parameters

time TimeSpan

The time at which to evaluate the velocity.

Returns

NFloat

The velocity in units per second.