toxi.math
Class DecimatedInterpolation
java.lang.Object
toxi.math.DecimatedInterpolation
- All Implemented Interfaces:
- InterpolateStrategy
public class DecimatedInterpolation
- extends java.lang.Object
- implements InterpolateStrategy
Delivers a number of decimated/stepped values for a given interval. E.g. by
using 5 steps the interpolation factor is decimated to: 0, 20, 40, 60, 80 and
100%. By default LinearInterpolation
is used, however any other
InterpolateStrategy
can be specified via the constructor.
Method Summary |
float |
interpolate(float a,
float b,
float f)
Implements an interpolation equation. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
numSteps
public int numSteps
strategy
public InterpolateStrategy strategy
DecimatedInterpolation
public DecimatedInterpolation(int steps)
DecimatedInterpolation
public DecimatedInterpolation(int steps,
InterpolateStrategy strategy)
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