|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softsynth.jmsl.util.ExponentialDecayInterpolator
public class ExponentialDecayInterpolator
Interpolate a value along an exponentially decreasing curve defined by two points
(x1,y1) and (x2,y2) where x1 < x2, y1 > y2.
The shape of f(x) = 1/exp(x) on the interval [0..steepness] is fitted to the user's endpoints.
That is, (x1,y1) corresponds to (0, 1) and (x2,y2) corresponds to (1,e^steepness), and this
new curve resembles a stretched or compressed version of the 1/exp(x) function.
Constructor Summary | |
---|---|
ExponentialDecayInterpolator(double x1,
double y1,
double x2,
double y2)
Construct an interpolator that fits a curve between (x1, y1) and (x2, y2) to an exponentially decaying function. |
Method Summary | |
---|---|
double |
interp(double x)
Interpolate a value along exponential curve |
void |
setInterp(double x1,
double y1,
double x2,
double y2)
Set two endpoints points on the desired curve, to be shaped as f(x)=1/exp(x) on (0,1)..(32, so (x1, y1) corresponds to (0,1) which is (0, 1/e^0) and (x2, y2) basically corresponds to at what point do you want x to give a value close to 0. |
void |
setSteepness(double s)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExponentialDecayInterpolator(double x1, double y1, double x2, double y2)
Method Detail |
---|
public void setInterp(double x1, double y1, double x2, double y2)
setInterp
in interface Interpolator
public double interp(double x)
interp
in interface Interpolator
public void setSteepness(double s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |