UtilEuclid Module
A module for math , logic utility functions and default tolerance values for use within Euclid.
Functions and values
| Function or value |
Description
|
Adds a Unit Of Measure to a float value. This is a compile time feature of F#. It's erased at runtime.
|
|
Full Usage:
``-1.0+1e-6``
Returns: float
|
The float literal that is -1.0 + 1e-6 This is literally -0.999999
|
Full Usage:
``-1.0-1e-6``
Returns: float
|
The float literal that is -1.0 - 1e-6 This is literally -1.000001
|
Full Usage:
``1.0+1e-6``
Returns: float
|
The float literal that is 1.0 + 1e-6 This is literally 1.000001
|
Full Usage:
``1.0-1e-6``
Returns: float
|
The float literal that is 1.0 - 1e-6 This is literally 0.999999
|
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 values between -1 and 1
|
Full Usage:
axisAlignmentTolerance
Returns: float
|
Tolerance for axis alignment: 1e-9 Used in Axis Alignment checks.
|
Full Usage:
clamp01 x
Parameters:
float
Returns: float
Modifiers: inline |
Clamp value between 0.0 and +1.0. Returns NaN for NaN
|
Full Usage:
clamp01NaN x
Parameters:
float
Returns: float
Modifiers: inline |
Clamp value between 0.0 and +1.0. Returns 0.0 for NaN
|
Full Usage:
clampBetweenMinusOneAndOne x
Parameters:
float
Returns: float
Modifiers: inline |
Clamp value between -1.0 and +1.0. Returns NaN for NaN
|
Full Usage:
countTooTinyOrNaN x
Parameters:
float
Returns: int
Modifiers: inline |
Returns 1 for values smaller than 1e-12 and for NaN. Otherwise returns 0 Uses UtilEuclid.zeroLengthTolerance
|
Full Usage:
countTooTinySqOrNaN x
Parameters:
float
Returns: int
Modifiers: inline |
Returns 1 for values smaller than 1e-24 (square of 1e-12) and for NaN. Otherwise returns 0 Uses UtilEuclid.zeroLengthTolSquared
|
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:
isBetweenZeroAndOneTolerantExcl x
Parameters:
float
Returns: bool
Modifiers: inline |
Check if value is between 0.0 and +1.0 exclusive a tolerance of 1e-6 . 1e-6 < x < 1.0 - 1e-6 Returns FALSE for NaN.
|
Full Usage:
isBetweenZeroAndOneTolerantIncl x
Parameters:
float
Returns: bool
Modifiers: inline |
Check if value is between 0.0 and +1.0 inclusive a tolerance of 1e-6 . -1e-6 < x < 1.0 + 1e-6 Returns FALSE for NaN.
|
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:
isNanInfinity x
Parameters:
float
Returns: bool
Modifiers: inline |
Returns TRUE if the float is NaN or Infinity.
|
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:
safeIdx i length
Parameters:
int
length : int
Returns: int
Modifiers: inline |
Any positive or negative 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.
|
Full Usage:
toDegrees radians
Parameters:
float
Returns: float
Modifiers: inline |
Converts angles from radians to degrees. By multiplying with 57.29... (180. / PI)
|
Full Usage:
toRadians degrees
Parameters:
float
Returns: float
Modifiers: inline |
Converts angles 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:
withMeasure x
Parameters:
float
Returns: float<'measure>
Modifiers: inline Type parameters: 'measure |
Adds a Unit Of Measure to a float value. This is a compile time feature of F#. It's erased at runtime.
|
Full Usage:
zeroLengthTolerance
Returns: float
|
Tolerance for zero length: 1e-12 in divisions and unitizing of vectors.
|
Euclid