HE_Mesh  5.1.2
wblut.math.WB_Epsilon Class Reference

Static Public Member Functions

static double clampEpsilon (final double x, final double min, final double max)
 
static boolean isEqualHybrid (final double x, final double y)
 
static boolean isEqualAbs (final double x, final double y)
 
static boolean isEqualRel (final double x, final double y)
 
static boolean isZero (final double x)
 
static boolean isZeroSq (final double x)
 
static int compareHybrid (final double x, final double y)
 
static int compareAbs (final double x, final double y)
 
static int compareRel (final double x, final double y)
 

Static Public Attributes

static double EPSILON = 1e-6
 
static double SQEPSILON = EPSILON * EPSILON
 
static double EPSILONANGLE = 1e-3 * Math.PI / 180.0
 

Detailed Description

WB_Epsilon contains functions for tolerance based floating point calculations.

Author
Frederik Vanhoutte, W:Blut

Member Function Documentation

static double wblut.math.WB_Epsilon.clampEpsilon ( final double  x,
final double  min,
final double  max 
)
static

Clamp value to range with error margin.

Parameters
x
min
max
Returns
clamped value
static int wblut.math.WB_Epsilon.compareAbs ( final double  x,
final double  y 
)
static

Compare with error margin using isEqualAbs.

Parameters
x
y
Returns
0 if equal, -1 if x<y, +1 if x>1
static int wblut.math.WB_Epsilon.compareHybrid ( final double  x,
final double  y 
)
static

Compare with error margin using isEqualHybrid.

Parameters
x
y
Returns
0 if equal, -1 if x<y, +1 if x>1
static int wblut.math.WB_Epsilon.compareRel ( final double  x,
final double  y 
)
static

Compare with error margin using isEqualRel.

Parameters
x
y
Returns
0 if equal, -1 if x<y, +1 if x>1
static boolean wblut.math.WB_Epsilon.isEqualAbs ( final double  x,
final double  y 
)
static

Equality with absolute error range.

Parameters
x
y
Returns
true, if equal
static boolean wblut.math.WB_Epsilon.isEqualHybrid ( final double  x,
final double  y 
)
static

Equality with error range. Absolute for small values, relative for large values

Parameters
x
y
Returns
true, if equal
static boolean wblut.math.WB_Epsilon.isEqualRel ( final double  x,
final double  y 
)
static

Equality with relative error range.

Parameters
x
y
Returns
true, if equal
static boolean wblut.math.WB_Epsilon.isZero ( final double  x)
static

Check if value is zero with error range.

Parameters
x
Returns
true, if zero
static boolean wblut.math.WB_Epsilon.isZeroSq ( final double  x)
static

Check if value is zero within squared error range.

Parameters
x
Returns
true, if zero

Member Data Documentation

double wblut.math.WB_Epsilon.EPSILON = 1e-6
static

General precision.

double wblut.math.WB_Epsilon.EPSILONANGLE = 1e-3 * Math.PI / 180.0
static
double wblut.math.WB_Epsilon.SQEPSILON = EPSILON * EPSILON
static

General precision when square is used > EPSILON*EPSILON.


The documentation for this class was generated from the following file: