Package toxi.math
Class SigmoidInterpolation
java.lang.Object
toxi.math.SigmoidInterpolation
- All Implemented Interfaces:
InterpolateStrategy
Implements the sigmoid interpolation function with adjustable curve sharpness
-
Constructor Summary
ConstructorDescriptionInitializes the s-curve with default sharpness = 2SigmoidInterpolation
(float s) -
Method Summary
Modifier and TypeMethodDescriptionfloat
double
interpolate
(double a, double b, double f) Implements an interpolation equation using double precision values.float
interpolate
(float a, float b, float f) Implements an interpolation equation using float values.
-
Constructor Details
-
SigmoidInterpolation
public SigmoidInterpolation()Initializes the s-curve with default sharpness = 2 -
SigmoidInterpolation
public SigmoidInterpolation(float s)
-
-
Method Details
-
getSharpness
public float getSharpness() -
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 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
-