Package toxi.math
Class CosineInterpolation
java.lang.Object
toxi.math.CosineInterpolation
- All Implemented Interfaces:
InterpolateStrategy
Implementation of the cosine interpolation function:
i = b+(a-b)*(0.5+0.5*cos(f*PI))
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
interpolate
(double a, double b, double f) Implements an interpolation equation using double precision values.final float
interpolate
(float a, float b, float f) Implements an interpolation equation using float values.
-
Constructor Details
-
CosineInterpolation
public CosineInterpolation()
-
-
Method Details
-
interpolate
public double interpolate(double a, double b, double f) Description copied from interface:InterpolateStrategy
Implements an interpolation equation using double precision values.- Specified by:
interpolate
in interfaceInterpolateStrategy
- Parameters:
a
- current valueb
- target valuef
- normalized interpolation factor (0.0 .. 1.0)- Returns:
- interpolated value
-
interpolate
public final float interpolate(float a, float b, float f) Description copied from interface:InterpolateStrategy
Implements an interpolation equation using float values.- Specified by:
interpolate
in interfaceInterpolateStrategy
- Parameters:
a
- current valueb
- target valuef
- normalized interpolation factor (0.0 .. 1.0)- Returns:
- interpolated value
-