toxi.math
Class SigmoidInterpolation

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

public class SigmoidInterpolation
extends java.lang.Object
implements InterpolateStrategy

Implements the sigmoid interpolation function with adjustable curve sharpness


Constructor Summary
SigmoidInterpolation()
          Initializes the s-curve with default sharpness = 2
SigmoidInterpolation(float s)
           
 
Method Summary
 float getSharpness()
           
 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

SigmoidInterpolation

public SigmoidInterpolation()
Initializes the s-curve with default sharpness = 2


SigmoidInterpolation

public SigmoidInterpolation(float s)
Method Detail

getSharpness

public float getSharpness()

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