toxi.math
Class ExponentialInterpolation

java.lang.Object
  extended by toxi.math.ExponentialInterpolation
All Implemented Interfaces:
InterpolateStrategy

public class ExponentialInterpolation
extends java.lang.Object
implements InterpolateStrategy

Exponential curve interpolation with adjustable exponent. Use exp in the following ranges to achieve these effects:


Constructor Summary
ExponentialInterpolation()
          Default constructor uses square parabola (exp=2)
ExponentialInterpolation(float exp)
           
 
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
 

Constructor Detail

ExponentialInterpolation

public ExponentialInterpolation()
Default constructor uses square parabola (exp=2)


ExponentialInterpolation

public ExponentialInterpolation(float exp)
Parameters:
exp - curve exponent
Method Detail

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 value
b - target value
f - normalized interpolation factor (0.0 .. 1.0)
Returns:
interpolated value