Namespace: DuMath

DuMath

Math related methods

Methods

staticDuMath.average(values){float}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5421
Calculates the average value in a list
Name Type Description
values Number | Array.<Number> values
Returns:
Type Description
float The average value

staticDuMath.clamp(values, min, max){Number|Array.<Number>}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5449
Clamps the value
Name Type Default Description
values Number | Array.<Number> values
min Number 0 optional The minimum value
max Number 1 optional The maximum value
Returns:
Type Description
Number | Array.<Number> The clamped values

staticDuMath.equals(value1, value2, floatPrecision){boolean}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5389
Compares two numbers
Name Type Default Description
value1 Number The first value
value2 Number The second value
floatPrecision int -1 optional The precision for (float) number comparison, number of decimals. Set to -1 to not use.
Returns:
Type Description
boolean true if the two values are equal

staticDuMath.gaussian(value, min, max, center, fwhm){Number}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5551
The gaussian function
Name Type Default Description
value Number The variable
min Number 0 optional The minimum return value
max Number 1 optional The maximum return value
center Number 0 optional The center of the peak
fwhm Number 1 optional The full width at half maximum of the curve
Returns:
Type Description
Number The result

staticDuMath.inverseGaussian(v, min, max, center, fwhm){Array.<Number>}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5591
The inverse gaussian function
Name Type Default Description
v Number The variable
min Number 0 optional The minimum return value of the corresponding gaussian function
max Number 1 optional The maximum return value of the corresponding gaussian function
center Number 0 optional The center of the peak of the corresponding gaussian function
fwhm Number 1 optional The full width at half maximum of the curve of the corresponding gaussian function
Returns:
Type Description
Array.<Number> The two possible results, the lower is the first in the list. If both are the same, it is the maximum

staticDuMath.inverseLogistic(v, midValue, min, max, rate){Number}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5530
The inverse logistic function (inverse sigmoid)
Name Type Default Description
v Number The variable
midValue Number 0 optional The midpoint value, at which the function returns max/2 in the original logistic function
min Number 0 optional The minimum return value of the original logistic function
max Number 1 optional The maximum return value of the original logistic function
rate Number 1 optional The logistic growth rate or steepness of the original logistic function
Returns:
Type Description
Number The result

staticDuMath.inverseReversedGaussian(value, min, max, center, fwhm){Array.<Number>}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5617
The inverse of the reversed gaussian function
Name Type Default Description
value Number The variable
min Number 0 optional The minimum return value of the corresponding gaussian function
max Number 1 optional The maximum return value of the corresponding gaussian function
center Number 0 optional The center of the peak of the corresponding gaussian function
fwhm Number 1 optional The full width at half maximum of the curve of the corresponding gaussian function
Returns:
Type Description
Array.<Number> The two possible results, the lower is the first in the list. If both are the same, it is the maximum

staticDuMath.isInside(point, bounds){Boolean}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5657
Checks if a point is located inside given bounds
Name Type Description
point Array.<float> The point
bounds Array.<float> The bounds. The number of bounds must be at least twice the number of dimensions, in this order : [a1, a2, ..., x1,x2,y1,y2,z1,z2]
Returns:
Type Description
Boolean true if the point is inside the bounds

staticDuMath.length(value1, value2){float}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5362
Measures the vector length between two points
Name Type Description
value1 Array.<int> The first value
value2 Array.<int> The second value
Returns:
Type Description
float The length

staticDuMath.linear(value, min, max, targetMin, targetMax, clamp){Number}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5633
The linear function
Name Type Default Description
value Number The variable
min Number 0 optional The minimum input value
max Number 1 optional The maximum input value
targetMin Number 0 optional The minimum output value
targetMax Number 1 optional The maximum output value
clamp Boolean false optional Whether to clamp the output value to the target or not.
Returns:
Type Description
Number

staticDuMath.log10(w){float}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5410
Calculates the log10 of a number
Name Type Description
w float The number
Returns:
Type Description
float The result of log10(x)
i.e. Math.log(x)/Math.LN10

staticDuMath.logistic(value, midValue, min, max, rate){Number}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5510
The logistic function (sigmoid)
Name Type Default Description
value Number The value
midValue Number 0 optional The midpoint value, at which the function returns max/2
min Number 0 optional The minimum return value
max Number 1 optional The maximum return value
rate Number 1 optional The logistic growth rate or steepness of the function
Returns:
Type Description
Number The result in the range [min, max] (excluding min and max)

staticDuMath.mean()

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5439
Alias for DuMath.average.

staticDuMath.random(min, max){int}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5342
Generates a random integer between minimum and maximum
Name Type Default Description
min int 0 optional The minimum value
max int 1 optional The maximum value
Returns:
Type Description
int The randomly generated integer

staticDuMath.reversedGaussian(value, min, max, center, fwhm){Number}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5576
A "reversed" gaussian function, growing faster with low value
Name Type Default Description
value Number The variable
min Number 0 optional The minimum return value
max Number 1 optional The maximum return value
center Number 0 optional The center of the peak
fwhm Number 1 optional The full width at half maximum of the curve
Returns:
Type Description
Number The result

staticDuMath.sign(num){int}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5676
Checks the sign of a number
Name Type Description
num Number The number to check
Returns:
Type Description
int 1 if num is positive, -1 if negative, 0 in other cases (0, NaN...)

staticDuMath.toDegrees(value){float}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5496
Converts the number from radians to degrees
Name Type Description
value number the value
Returns:
Type Description
float The value in degrees

staticDuMath.toRadians(value){float}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5485
Converts the number from degrees to radians
Name Type Description
value number the value
Returns:
Type Description
float The value in radians