UtilEuclid Module
Math Utility functions and values for use within Euclid.
Functions and values
Function or value |
Description
|
Full Usage:
``-1.0+1e-6``
Returns: float
|
The float number that is 9 increments smaller than -1.0. This is approx -1.0 + 1e-6 see https://float.exposed/0xbf800009
|
Full Usage:
``-1.0-1e-6``
Returns: float
|
The float number that is 16 increments bigger than 1.0. This is approx 1.0 - 1e-6 see https://float.exposed/0xbf7ffff0
|
Full Usage:
``1.0+1e-6``
Returns: float
|
The float number that is 9 increments bigger than 1.0. This is approx 1.0 + 1e-6 see https://float.exposed/0x3f800009
|
Full Usage:
``1.0-1e-6``
Returns: float
|
The float number that is 16 increments smaller than 1.0. This is approx 1.0 - 1e-6 see https://float.exposed/0x3f7ffff0
|
Full Usage:
acosSafe a
Parameters:
float
Returns: float
Modifiers: inline |
A safe arccosine (Inverse Cosine) function. It clamps the input between -1 and 1
|
Full Usage:
asinSafe a
Parameters:
float
Returns: float
Modifiers: inline |
A safe arcsine (Inverse Sine) function. It clamps the input between -1 and 1
|
Full Usage:
clampBetweenMinusOneAndOne x
Parameters:
float
Returns: float
Modifiers: inline |
Clamp value between -1.0 and +1.0
|
Full Usage:
clampBetweenZeroAndOne x
Parameters:
float
Returns: float
Modifiers: inline |
Clamp value between 0.0 and +1.0
|
Full Usage:
halfPi
Returns: float
|
Math.PI * 0.5 This is equal to 90 degrees in radians.
|
Full Usage:
isBetweenZeroAndOne x
Parameters:
float
Returns: bool
Modifiers: inline |
Check if value is between 0.0 and +1.0 inclusive.
|
Full Usage:
isBetweenZeroAndOneTolerant x
Parameters:
float
Returns: bool
Modifiers: inline |
Check if value is between 0.0 and +1.0 inclusive a tolerance of 1e-6 .
|
Full Usage:
isMinusOne x
Parameters:
float
Returns: bool
Modifiers: inline |
Tests if a number is close to minus 1.0 by a 1e-6 tolerance. This is a float increment of 6 steps or decrement of 16 steps.
|
Full Usage:
isNegative x
Parameters:
float
Returns: bool
Modifiers: inline |
Returns true for negative number and for NaN 0.0 and -0.0 is not negative.
|
Full Usage:
isNotOne x
Parameters:
float
Returns: bool
Modifiers: inline |
Tests if a number is NOT close to 1.0 by a 1e-6 tolerance. This is a float increment of 6 steps or decrement of 16 steps. Also returns true for NaN.
|
Full Usage:
isNotZero x
Parameters:
float
Returns: bool
Modifiers: inline |
Tests if a number is NOT close to 0.0 by 1e-6 This is approximately the same tolerance that 6 increments of a float are away from 1.0. See Euclid.UtilEuclid.isOne function. Also returns true for NaN.
|
Full Usage:
isOne x
Parameters:
float
Returns: bool
Modifiers: inline |
Tests if a number is close to 1.0 by a 1e-6 tolerance. This is a float increment of 6 steps or decrement of 16 steps.
|
Full Usage:
isTooSmall x
Parameters:
float
Returns: bool
Modifiers: inline |
Returns true for values smaller than 1e-6 and for NaN
|
Full Usage:
isTooSmallSq x
Parameters:
float
Returns: bool
Modifiers: inline |
Returns true for values smaller than 1e-12 (square of 1e-6) and for NaN
|
Full Usage:
isTooTiny x
Parameters:
float
Returns: bool
Modifiers: inline |
Returns true for values smaller than 1e-12 and for NaN uses UtilEuclid.zeroLengthTolerance
|
Full Usage:
isTooTinySq x
Parameters:
float
Returns: bool
Modifiers: inline |
Returns true for values smaller than 1e-24 (square of 1e-12) and for NaN uses UtilEuclid.zeroLengthTolSquared
|
Full Usage:
isZero x
Parameters:
float
Returns: bool
Modifiers: inline |
Tests if a number is close to 0.0 by 1e-6 This is approximately the same tolerance that 6 increments of a float are away from 1.0. See Euclid.UtilEuclid.isOne function.
|
Full Usage:
matchSign signedValue numToMatch
Parameters:
float
numToMatch : float
Returns: float
|
Match the sign (+ or -) to a given number.
|
Full Usage:
notNull x
Parameters:
'a
Returns: bool
Modifiers: inline Type parameters: 'a |
Test is a value is not null.
|
Full Usage:
saveIdx i length
Parameters:
int
length : int
Returns: int
Modifiers: inline |
Any int will give a valid index for given collection size. Converts negative indices to positive ones and loops to start after last index is reached. Returns a valid index for a collection of 'length' items for any integer.
|
Full Usage:
toDegrees radians
Parameters:
float
Returns: float
Modifiers: inline |
Converts Angels from Radians to Degrees. By multiplying with 57.29... (180. / PI)
|
Full Usage:
toRadians degrees
Parameters:
float
Returns: float
Modifiers: inline |
Converts Angels from Degrees to Radians. By multiplying with 0.0174... (PI / 180.)
|
Full Usage:
twoPi
Returns: float
|
Math.PI * 2.0 This is equal to 360 degrees in radians.
|
Full Usage:
zeroLengthTolerance
Returns: float
|
Tolerance for zero length: 1e-12 in divisions and unitizing of vectors.
|