Provides methods for real numbers, that were forgotten by the Math class.
Static member | Description |
Full Usage:
RMath.Acosh(x)
Parameters:
float
Returns: float
|
|
Full Usage:
RMath.Asinh(x)
Parameters:
float
Returns: float
|
|
Full Usage:
RMath.Atanh(x)
Parameters:
float
Returns: float
|
|
Full Usage:
RMath.ClampToInterval(x, xmin, xmax)
Parameters:
float
-
The x value.
xmin : float
-
The interval minimum.
xmax : float
-
The interval maximum.
Returns: float
The value x clamped to the interval [xmin, xmax]. If Double.NaN is provided, the return value is Double.NaN.
|
Clamps the value x to the interval [xmin, xmax]. If Double.NaN is provided, the return value is Double.NaN.
|
Full Usage:
RMath.Hypot(x, y)
Parameters:
float
-
First argument.
y : float
-
Second argument.
Returns: float
Square root of the sum of x-square and y-square.
|
The standard hypot() function for two arguments taking care of overflows and zerodivides.
|
Full Usage:
RMath.InFractionOfUnorderedIntervalCC(x, leftValue, rightValue)
Parameters:
float
-
The x value.
leftValue : float
-
The left value of the interval, might be less than or greater than rightValue.
rightValue : float
-
The right value of the interval, might be less than or greater han leftValue.
Returns: Nullable<float>
|
If x is inside the interval [leftValue, rightValue] or [rightValue, leftValue], then this function returns a value in the range [0,1] designating the (linear) position inside that interval. I.e. if rightValue > leftValue, the return value would be (x-leftValue)/(rightValue-leftValue).
|
Full Usage:
RMath.InterpolateLinear(fraction, leftValue, rightValue)
Parameters:
float
-
The fraction value.
leftValue : float
-
The left value.
rightValue : float
-
The right value.
Returns: float
(1-fraction)*leftValue + fraction*rightValue. If fraction is either 0 or 1, only the leftValue or the rightValue will be used as return value, respectively.
|
Interpolates linearly between leftValue and rightValue, using the parameter fraction.
|
Full Usage:
RMath.InterpolateLinear(index, array, ?extendToSides)
Parameters:
float
-
The index into the array. Can be fractional.
array : float[]
-
The array.
?extendToSides : bool
-
If true and the value of index is out of range, the values of the array
at the left side or the right side will be returned; otherwise, if the index is out of range, an exception will be thrown.
Returns: float
The interpolated value at the fractional index.
|
Interpolates values of an array.
|
Full Usage:
RMath.IsFinite(x)
Parameters:
float
-
Number to test.
Returns: bool
True if x is finite. False if is is not finite or is double.NaN.
|
Tests if x is finite, i.e. is in the interval [double.MinValue, double.MaxValue].
|
Full Usage:
RMath.IsFinite(x)
Parameters:
float32
-
Number to test.
Returns: bool
True if x is finite. False if is is not finite or is double.NaN.
|
Tests if x is finite, i.e. is in the interval [float.MinValue, float.MaxValue].
|
Full Usage:
RMath.IsInIntervalCC(x, xmin, xmax)
Parameters:
float
-
The argument.
xmin : float
-
The lower boundary of the interval.
xmax : float
-
The upper boundary of the interval.
Returns: bool
True if xmin <= x and x <= xmax.
|
Tests whether or not x is in the closed interval [xmin, xmax]. No test is done if xmin is less than xmax.
|
Full Usage:
RMath.IsInIntervalCO(x, xmin, xmax)
Parameters:
float
-
The argument.
xmin : float
-
The lower boundary of the interval.
xmax : float
-
The upper boundary of the interval.
Returns: bool
True if xmin <= x and x < xmax.
|
Tests whether or not x is in the semi-open interval [xmin, xmax). No test is done if xmin is less than xmax.
|
Full Usage:
RMath.IsInIntervalOC(x, xmin, xmax)
Parameters:
float
-
The argument.
xmin : float
-
The lower boundary of the interval.
xmax : float
-
The upper boundary of the interval.
Returns: bool
True if xmin < x and x <= xmax.
|
Tests whether or not x is in the semi-open interval (xmin, xmax]. No test is done if xmin is less than xmax.
|
Full Usage:
RMath.IsInIntervalOO(x, xmin, xmax)
Parameters:
float
-
The argument.
xmin : float
-
The lower boundary of the interval.
xmax : float
-
The upper boundary of the interval.
Returns: bool
True if xmin < x and x < xmax.
|
Tests whether or not x is in the open interval (xmin, xmax). No test is done if xmin is less than xmax.
|
Full Usage:
RMath.IsNaN(x)
Parameters:
float
-
Number to test.
Returns: bool
True if x is NaN.
|
Test if x is not a number.
|
Full Usage:
RMath.IsNaN(x)
Parameters:
float32
-
Number to test.
Returns: bool
True if x is NaN.
|
Test if x is not a number.
|
Full Usage:
RMath.Log1p(x)
Parameters:
float
Returns: float
|
|
Full Usage:
RMath.OneMinusExp(x)
Parameters:
float
-
Function argument
Returns: float
The value 1-Exp(x)
|
Calculates 1-Exp(x) with better accuracy around x=0.
|
Full Usage:
RMath.Pow(x, n)
Parameters:
float
-
n : int
-
Returns: float
|
Calculates x^n by repeated multiplications. The algorithm takes ld(n) multiplications. This algorithm can also be used with negative n.
|
Full Usage:
RMath.Pow(x, n)
Parameters:
float
-
n : int64
-
Returns: float
|
Calculates x^n by repeated multiplications. The algorithm takes ld(n) multiplications. This algorithm can also be used with negative n.
|
Full Usage:
RMath.Pow2(x)
Parameters:
float
-
Argument.
Returns: float
x squared.
|
Calculates x^2 (square of x).
|
Full Usage:
RMath.Pow3(x)
Parameters:
float
Returns: float
|
|
Full Usage:
RMath.Pow4(x)
Parameters:
float
Returns: float
|
|
Full Usage:
RMath.Pow5(x)
Parameters:
float
Returns: float
|
|
Full Usage:
RMath.Pow6(x)
Parameters:
float
Returns: float
|
|
Full Usage:
RMath.Pow7(x)
Parameters:
float
Returns: float
|
|
Full Usage:
RMath.Pow8(x)
Parameters:
float
Returns: float
|
|
Full Usage:
RMath.Pow9(x)
Parameters:
float
Returns: float
|
|
Full Usage:
RMath.ScaleDecadic(x, n)
Parameters:
float
-
The scaling factor.
n : int
-
The decadic exponent.
Returns: float
The product x * 10^n.
|
Calculates x * 10^n.
|