Package mgui.util
Class MathFunctions
java.lang.Object
mgui.util.MathFunctions
public class MathFunctions
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description MathFunctions() -
Method Summary
Modifier and Type Method Description static doubleceil(double m, double n)Rounds m up to the next multiple of nstatic Jama.MatrixgetMatrixFromPoint3d(org.jogamp.vecmath.Point3d p)static org.jogamp.vecmath.Point3dgetPoint3dFromMatrix(Jama.Matrix m)static doubleinterpolate(double v1, double v2, double val)static doublelogn(double a, double n)Computes log to basenofa.static doublenormalize(double min, double max, double val)Normalizevalto the range [min:max].static doubleunnormalize(double min, double max, double val)Unnormalizevalto the range [min:max].Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MathFunctions
public MathFunctions()
-
-
Method Details
-
interpolate
public static double interpolate(double v1, double v2, double val) -
normalize
public static double normalize(double min, double max, double val)Normalizevalto the range [min:max]. If val is outside the range [min:max], it is set to the nearest limit (0 or 1).- Parameters:
min-max-val-- Returns:
- normalized value
-
unnormalize
public static double unnormalize(double min, double max, double val)Unnormalizevalto the range [min:max].- Parameters:
min-max-val-- Returns:
- normalized value
-
ceil
public static double ceil(double m, double n)Rounds m up to the next multiple of n- Parameters:
m-n-- Returns:
-
getPoint3dFromMatrix
public static org.jogamp.vecmath.Point3d getPoint3dFromMatrix(Jama.Matrix m) -
getMatrixFromPoint3d
public static Jama.Matrix getMatrixFromPoint3d(org.jogamp.vecmath.Point3d p) -
logn
public static double logn(double a, double n)Computes log to basenofa.- Parameters:
a-n-- Returns:
-