|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hermit.geometry.MathTools
public class MathTools
Mathematical utilities for geometric calculations.
This package provides mathematical comparisons which ignore the lowest bits of the provided values. This is useful when comparing values which should be equal, except for floating-point representability and rounding.
Constructor Summary | |
---|---|
MathTools()
|
Method Summary | |
---|---|
static boolean |
eq(double a,
double b)
Determine whether two values are equal to within the current precision. |
static boolean |
lt(double a,
double b)
Determine whether a value is less than another to within the current precision. |
static double |
round(double val)
Return the given value rounded according to the current precision. |
static void |
setPrecision(double val)
Set the precision for calculations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MathTools()
Method Detail |
---|
public static final void setPrecision(double val)
val
- The precision as a scaling factor.public static final double round(double val)
val
- The value to round.
public static final boolean eq(double a, double b)
a
- One value to compare.b
- The other value to compare.
public static final boolean lt(double a, double b)
a
- One value to compare.b
- The other value to compare.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |