Class Interpolation
- Namespace
- PlumJsonAnimator.Services
- Assembly
- PlumJsonAnimator.dll
Provides interpolation methods for animations and method for finding interpolation parameter t.
public class Interpolation
- Inheritance
-
Interpolation
- Inherited Members
Methods
angleInterpolation(double, double, double)
Angle interpolation with shortest path (handles 360° wrap-around)
public double angleInterpolation(double start, double end, double t)
Parameters
startdoubleStart angle in degrees
enddoubleEnd angle in degrees
tdoubleInterpolation parameter (0 to 1)
Returns
Examples
new Interpolation().angleInterpolation(350, 10, 0.5);
findInterpolateParam(double, double)
Calculates interpolation parameter t from elapsed time
public double findInterpolateParam(double segmentDuration, double timeElapsed)
Parameters
Returns
- double
t value clamped between 0 and 1
Examples
new Interpolation().findInterpolateParam(10, 6); //Returns 0.6
linearInterpolation(double, double, double)
Linear interpolation between two values
public double linearInterpolation(double start, double end, double t)
Parameters
startdoubleStart value at t=0
enddoubleEnd value at t=1
tdoubleInterpolation parameter (0 to 1)
Returns
Examples
new Interpolation().linearInterpolation(20, 40, 0.5);