Package toxi.math
Class LinearInterpolation
java.lang.Object
toxi.math.LinearInterpolation
- All Implemented Interfaces:
InterpolateStrategy
Implementation of the linear interpolation function
i = a + ( b - a ) * f
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleinterpolate(double a, double b, double f) Implements an interpolation equation using double precision values.final floatinterpolate(float a, float b, float f) Implements an interpolation equation using float values.
-
Constructor Details
-
LinearInterpolation
public LinearInterpolation()
-
-
Method Details
-
interpolate
public double interpolate(double a, double b, double f) Description copied from interface:InterpolateStrategyImplements an interpolation equation using double precision values.- Specified by:
interpolatein 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:InterpolateStrategyImplements an interpolation equation using float values.- Specified by:
interpolatein interfaceInterpolateStrategy- Parameters:
a- current valueb- target valuef- normalized interpolation factor (0.0 .. 1.0)- Returns:
- interpolated value
-