JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
Basic Double math utility functions. More...
Static Public Member Functions | |
static double | getMachineEpsilon () |
Return computed machine Epsilon value. More... | |
static double | adegToRad (final double arc_degree) |
Converts arc-degree to radians. More... | |
static double | radToADeg (final double rad) |
Converts radians to arc-degree. More... | |
static boolean | isEqualRaw (final double a, final double b) |
Return true if both values are equal w/o regarding an epsilon. More... | |
static boolean | isEqual (final double a, final double b, final double epsilon) |
Returns true if both values are equal, i.e. More... | |
static boolean | isEqual (final double a, final double b) |
Returns true if both values are equal, i.e. More... | |
static boolean | isEqual2 (final double a, final double b) |
Returns true if both values are equal, i.e. More... | |
static int | compare (final double a, final double b) |
Returns true if both values are equal w/o regarding an epsilon. More... | |
static int | compare (final double a, final double b, final double epsilon) |
Returns -1 , 0 or 1 if a is less, equal or greater than b , taking epsilon into account for equality. More... | |
static boolean | isZero (final double a, final double epsilon) |
Returns true if value is zero, i.e. More... | |
static boolean | isZero (final double a) |
Returns true if value is zero, i.e. More... | |
Static Public Attributes | |
static final double | E = 2.7182818284590452354 |
static final double | PI = 3.14159265358979323846 |
The value PI, i.e. More... | |
static final double | TWO_PI = 2.0 * PI |
The value 2PI, i.e. More... | |
static final double | HALF_PI = PI / 2.0 |
The value PI/2, i.e. More... | |
static final double | QUARTER_PI = PI / 4.0 |
The value PI/4, i.e. More... | |
static final double | SQUARED_PI = PI * PI |
The value PI^2. More... | |
static final double | EPSILON = 2.220446049250313E-16 |
Epsilon for floating point {@value}, as once computed via getMachineEpsilon() on an AMD-64 CPU. More... | |
static final double | INV_DEVIANCE = 1.0E-8f |
Inversion Epsilon, used with equals method to determine if two inverted matrices are close enough to be considered equal. More... | |
Basic Double math utility functions.
Definition at line 33 of file DoubleUtil.java.
|
static |
Converts arc-degree to radians.
Definition at line 89 of file DoubleUtil.java.
|
static |
Returns true if both values are equal w/o regarding an epsilon.
Implementation considers following corner cases:
Definition at line 223 of file DoubleUtil.java.
|
static |
Returns -1
, 0
or 1
if a
is less, equal or greater than b
, taking epsilon
into account for equality.
epsilon
is allowed to be 0
.
Implementation considers following corner cases:
Definition at line 259 of file DoubleUtil.java.
|
static |
Return computed machine Epsilon value.
The machine Epsilon value is computed once.
Definition at line 59 of file DoubleUtil.java.
|
static |
Returns true if both values are equal, i.e.
their absolute delta < EPSILON
.
Implementation considers following corner cases:
Definition at line 189 of file DoubleUtil.java.
|
static |
Returns true if both values are equal, i.e.
their absolute delta < epsilon
if 0 != epsilon
, otherwise == 0
.
epsilon
is allowed to be 0
.
Implementation considers following corner cases:
Definition at line 167 of file DoubleUtil.java.
|
static |
Returns true if both values are equal, i.e.
their absolute delta < EPSILON
.
Implementation does not consider corner cases like isEqual(float, float, float)
.
Definition at line 205 of file DoubleUtil.java.
|
static |
Return true if both values are equal w/o regarding an epsilon.
Implementation considers following corner cases:
Definition at line 146 of file DoubleUtil.java.
|
static |
Returns true if value is zero, i.e.
it's absolute value < EPSILON
.
Definition at line 290 of file DoubleUtil.java.
|
static |
Returns true if value is zero, i.e.
it's absolute value < epsilon
if 0 != epsilon
, otherwise 0 == a
.
epsilon
is allowed to be 0
.
return 0 == epsilon && 0 == a || 0 != epsilon && Math.abs(a) < epsilon
a | value to test |
epsilon | optional positive epsilon value, maybe 0 |
Definition at line 281 of file DoubleUtil.java.
|
static |
Converts radians to arc-degree.
Definition at line 94 of file DoubleUtil.java.
|
static |
Definition at line 71 of file DoubleUtil.java.
|
static |
Epsilon for floating point {@value}, as once computed via getMachineEpsilon()
on an AMD-64 CPU.
Definition of machine epsilon guarantees that:
1.0 + EPSILON != 1.0
In other words: machEps is the maximum relative error of the chosen rounding procedure.
A number can be considered zero if it is in the range (or in the set):
MaybeZeroSet e ]-machEps .. machEps[ (exclusive)
While comparing floating point values, machEps allows to clip the relative error:
boolean isZero = afloat < EPSILON; boolean isNotZero = afloat >= EPSILON; boolean isEqual = abs(bfloat - afloat) < EPSILON; boolean isNotEqual = abs(bfloat - afloat) >= EPSILON;
Definition at line 124 of file DoubleUtil.java.
|
static |
|
static |
Inversion Epsilon, used with equals method to determine if two inverted matrices are close enough to be considered equal.
Using {@value}, which is ~100 times DoubleUtil#EPSILON
.
Definition at line 132 of file DoubleUtil.java.
|
static |
|
static |
The value PI^2.
Definition at line 86 of file DoubleUtil.java.
|
static |