toxi.math
Class CircularInterpolation
java.lang.Object
toxi.math.CircularInterpolation
- All Implemented Interfaces:
- InterpolateStrategy
public class CircularInterpolation
- extends java.lang.Object
- implements InterpolateStrategy
Implementation of the circular interpolation function.
i = a-(b-a) * (sqrt(1 - (1 - f) * (1 - f) ))
Constructor Summary |
CircularInterpolation()
|
CircularInterpolation(boolean isFlipped)
The interpolation slope can be flipped to have its steepest ascent
towards the end value, rather than at the beginning in the default
configuration. |
Method Summary |
float |
interpolate(float a,
float b,
float f)
Implements an interpolation equation. |
void |
setFlipped(boolean isFlipped)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CircularInterpolation
public CircularInterpolation()
CircularInterpolation
public CircularInterpolation(boolean isFlipped)
- The interpolation slope can be flipped to have its steepest ascent
towards the end value, rather than at the beginning in the default
configuration.
- Parameters:
isFlipped
- true, if slope is inverted
interpolate
public float interpolate(float a,
float b,
float f)
- Description copied from interface:
InterpolateStrategy
- Implements an interpolation equation.
- Specified by:
interpolate
in interface InterpolateStrategy
- Parameters:
a
- current valueb
- target valuef
- normalized interpolation factor (0.0 .. 1.0)
- Returns:
- interpolated value
setFlipped
public void setFlipped(boolean isFlipped)