FzMath

Some general purpose Math functions

Methods

static gaussian(value, minopt, maxopt, centeropt, fwhmopt) → {Number}

The gaussian function
Parameters:
Name Type Attributes Default Description
value Number The variable
min Number <optional>
0 The minimum return value
max Number <optional>
1 The maximum return value
center Number <optional>
0 The center of the peak
fwhm Number <optional>
1 The full width at half maximum of the curve
Returns:
Number - The result

static inverseGaussian(v, minopt, maxopt, centeropt, fwhmopt) → {Array.<Number>}

The inverse gaussian function
Parameters:
Name Type Attributes Default Description
v Number The variable
min Number <optional>
0 The minimum return value of the corresponding gaussian function
max Number <optional>
1 The maximum return value of the corresponding gaussian function
center Number <optional>
0 The center of the peak of the corresponding gaussian function
fwhm Number <optional>
1 The full width at half maximum of the curve of the corresponding gaussian function
Returns:
Array.<Number> - The two possible results, the lower is the first in the list. If both are the same, it is the maximum

static inverseLogistic(v, midValueopt, minopt, maxopt, rateopt) → {Number}

The inverse logistic function (inverse sigmoid)
Parameters:
Name Type Attributes Default Description
v Number The variable
midValue Number <optional>
0 The midpoint value, at which the function returns max/2 in the original logistic function
min Number <optional>
0 The minimum return value of the original logistic function
max Number <optional>
1 The maximum return value of the original logistic function
rate Number <optional>
1 The logistic growth rate or steepness of the original logistic function
Returns:
Number - The result

static inverseReversedGaussian(v, minopt, maxopt, centeropt, fwhmopt) → {Array.<Number>}

The inverse of the reversed gaussian function
Parameters:
Name Type Attributes Default Description
v Number The variable
min Number <optional>
0 The minimum return value of the corresponding gaussian function
max Number <optional>
1 The maximum return value of the corresponding gaussian function
center Number <optional>
0 The center of the peak of the corresponding gaussian function
fwhm Number <optional>
1 The full width at half maximum of the curve of the corresponding gaussian function
Returns:
Array.<Number> - The two possible results, the lower is the first in the list. If both are the same, it is the maximum

static logistic(value, midValueopt, minopt, maxopt, rateopt) → {Number}

The logistic function (sigmoid)
Parameters:
Name Type Attributes Default Description
value Number The value
midValue Number <optional>
0 The midpoint value, at which the function returns max/2
min Number <optional>
0 The minimum return value
max Number <optional>
1 The maximum return value
rate Number <optional>
1 The logistic growth rate or steepness of the function
Returns:
Number - The result in the range [min, max] (excluding min and max)

static mean(values) → {Number}

Returns the mean of a set of values
Parameters:
Name Type Description
values Array.<Number> The values
Returns:
Number - The mean

static reversedGaussian(value, minopt, maxopt, centeropt, fwhmopt) → {Number}

A "reversed" gaussian function, growing faster with low value
Parameters:
Name Type Attributes Default Description
value Number The variable
min Number <optional>
0 The minimum return value
max Number <optional>
1 The maximum return value
center Number <optional>
0 The center of the peak
fwhm Number <optional>
1 The full width at half maximum of the curve
Returns:
Number - The result