org.das2.util.DasMath


biggerOf

biggerOf( double x1, double x2 ) → double

Returns:

double

search for examples view on GitHub view source


exp10

exp10( double x ) → double

Returns:

double

search for examples view on GitHub view source


findex

findex( double[] datax, double[] x ) → double

Returns the "floating point indeces" of x within array datax. A floating point index (or "findex") indicates the indeces of the points that bracket and the weights of each bracketing point to use. A findex of 4.5 indicates that x is half-way between index 4 and 5, so equal weights should be used. floor( findex ) is the "left" bracket, ceil(findex) is the "right" bracket, and fp( findex ) is the weight for the right bracket. See interpolate for an example of its use.

Returns:

double[]

search for examples view on GitHub view source


gcd

gcd( double[] A, double error ) → double

Returns:

double

search for examples view on GitHub view source


log10

log10( double x ) → double

Returns:

double

search for examples view on GitHub view source


max

max( double[] A ) → double

return the maximum of the list

Parameters

A - the list

Returns:

the maximum of the list

search for examples view on GitHub view source


mean

mean( double[] A ) → double

return the mean of the list. The first element's magnitude is removed from each accumulated value so that items with large offset values (for example times) can be averaged. There is no checking for NaNs or fill values.

Parameters

A -

Returns:

the mean of the list.

search for examples view on GitHub view source


median

median( double[] A ) → double

return the median of the list length N, which is the value at index N/2 of the sorted list. This does not return the average for even-length lists. and there is no checking for NaNs or fill values.

Parameters

A -

Returns:

the median of the list

search for examples view on GitHub view source


min

min( double[] A ) → double

return the minimum of the list

Parameters

A - the list

Returns:

the minimum of the list

search for examples view on GitHub view source


modp

modp( double x, double t ) → double

just like modulo (%) function, but negative numbers return positive phase.

Returns:

double

search for examples view on GitHub view source


roundNFractionalDigits

roundNFractionalDigits( double x, int n ) → double

Returns:

double

search for examples view on GitHub view source


roundNSignificantDigits

roundNSignificantDigits( double x, int n ) → double

Returns:

double

search for examples view on GitHub view source


sort

sort( double[] A ) → double

return a sorted version of the array. The original array is not modified.

Parameters

A -

Returns:

return a sorted version of the array.

search for examples view on GitHub view source


tanh

tanh( double x ) → double

Returns:

double

search for examples view on GitHub view source