org.das2.util
Class DasMath

java.lang.Object
  extended by org.das2.util.DasMath

public class DasMath
extends java.lang.Object


Constructor Summary
DasMath()
          Creates a new instance of DasMath
 
Method Summary
static double biggerOf(double x1, double x2)
           
static double exp10(double x)
           
static double exp10(int x)
           
static double[] findex(double[] datax, double[] x)
          Returns the "floating point indeces" of x within array datax.
static double findex(double[] datax, double x, int guess)
           
static double gcd(double[] A, double error)
           
static double interpolate(double[] datay, double findex)
          Interpolate just one point
static double[] interpolate(double[] datay, double[] findex)
          interpolate an array of points.
static double log10(double x)
           
static void main(java.lang.String[] args)
           
static double max(double[] A)
           
static double mean(double[] A)
           
static double median(double[] A)
           
static double min(double[] A)
           
static double modp(double x, double t)
          just like modulo (%) function, but negative numbers return positive phase.
static int modp(int x, int t)
          just like modulo (%) function, but negative numbers return positive phase.
static double roundNFractionalDigits(double x, int n)
           
static double roundNSignificantDigits(double x, int n)
           
static double[] sort(double[] A)
           
static double tanh(double x)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DasMath

public DasMath()
Creates a new instance of DasMath

Method Detail

log10

public static double log10(double x)

exp10

public static double exp10(double x)

exp10

public static double exp10(int x)

roundNFractionalDigits

public static double roundNFractionalDigits(double x,
                                            int n)

roundNSignificantDigits

public static double roundNSignificantDigits(double x,
                                             int n)

tanh

public static double tanh(double x)

interpolate

public static double interpolate(double[] datay,
                                 double findex)
Interpolate just one point


interpolate

public static double[] interpolate(double[] datay,
                                   double[] findex)
interpolate an array of points.


findex

public static double[] findex(double[] datax,
                              double[] x)
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.


findex

public static final double findex(double[] datax,
                                  double x,
                                  int guess)

main

public static void main(java.lang.String[] args)

modp

public static double modp(double x,
                          double t)
just like modulo (%) function, but negative numbers return positive phase.


modp

public static int modp(int x,
                       int t)
just like modulo (%) function, but negative numbers return positive phase.


biggerOf

public static double biggerOf(double x1,
                              double x2)

gcd

public static double gcd(double[] A,
                         double error)

mean

public static double mean(double[] A)

median

public static double median(double[] A)

max

public static double max(double[] A)

min

public static double min(double[] A)

sort

public static double[] sort(double[] A)