Package samer.maths
Class FunctionMap
- java.lang.Object
-
- IMap
-
- samer.maths.FunctionMap
-
public class FunctionMap extends IMap
This class maps a given interval of real numbers to the interval [0,1], returning either the real number, or converting it to an integer between 0 and a given value (defaults to 256).
-
-
Constructor Summary
Constructors Constructor and Description FunctionMap(int m, Function fn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
clipInt(double t)
double
getDomainMax()
double
getDomainMin()
double
inverse(double t)
double
inverseFromInt(int i)
double
map(double t)
void
setDomain(double t1, double t2)
void
setFunction(Function fn)
int
toInt(double t)
-
-
-
Constructor Detail
-
FunctionMap
public FunctionMap(int m, Function fn)
-
-
Method Detail
-
setFunction
public void setFunction(Function fn)
-
getDomainMin
public double getDomainMin()
-
getDomainMax
public double getDomainMax()
-
setDomain
public void setDomain(double t1, double t2)
-
map
public final double map(double t)
-
clipInt
public final int clipInt(double t)
-
toInt
public final int toInt(double t)
-
inverse
public double inverse(double t)
-
inverseFromInt
public double inverseFromInt(int i)
-
-