cds.astro
Class AstroMath

java.lang.Object
  extended by cds.astro.AstroMath

public class AstroMath
extends java.lang.Object

Trigonometric and a few other functions used in the astronomical context. This class includes also 3x3 matrix manipulation. Extracted from Class Coo


Field Summary
static double ARCSEC
           
static double DEG
           
static double DEG2
           
static double[] powers
           
 
Constructor Summary
AstroMath()
           
 
Method Summary
static double asinc(double x)
          Function asinc(x), inverse function of sinc
static double asind(double x)
          sin-1 (inverse function of sine), gives argument in degrees
static double atan2d(double y, double x)
          get the polar angle from 2-D cartesian coordinates
static double atand(double x)
          tan-1 (inverse function of tangent), gives argument in degrees
static double atanh(double x)
          tanh-1 (inverse function of tanh)
static double cosd(double x)
          Cosine when argument in degrees
static double cosh(double x)
          Hyperbolic cosine cosh = (exp(x) + exp(-x))/2
static double dexp(double x)
          Compute just 10x
static double dexp(int n)
          Compute just 10n
static double ell1(double a, double b)
          Computation of complete elliptic integral of first kind.
static double log(double x)
          Compute the log base 10
static double[][] m3p(double[][] A, double[][] B)
          3-Matrices Products
static double[][] m3t(double[][] A)
          Transposed of a Matrix
static double sinc(double x)
          Function sinc(x) = sin(x)/x
static double sind(double x)
          Sine when argument in degrees
static double tand(double x)
          Tangent when argument in degrees
static double tanh(double x)
          Hyperbolic tangent = (exp(x)-exp(-x))/(exp(x)+exp(-x))
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

powers

public static final double[] powers

DEG

public static final double DEG
See Also:
Constant Field Values

DEG2

public static final double DEG2
See Also:
Constant Field Values

ARCSEC

public static final double ARCSEC
See Also:
Constant Field Values
Constructor Detail

AstroMath

public AstroMath()
Method Detail

cosd

public static final double cosd(double x)
Cosine when argument in degrees

Parameters:
x - angle in degrees
Returns:
the cosine

sind

public static final double sind(double x)
Sine when argument in degrees

Parameters:
x - angle in degrees
Returns:
the sine

tand

public static final double tand(double x)
Tangent when argument in degrees

Parameters:
x - angle in degrees
Returns:
the tan

asind

public static final double asind(double x)
sin-1 (inverse function of sine), gives argument in degrees

Parameters:
x - argument
Returns:
y value such that sin(y) = x

atand

public static final double atand(double x)
tan-1 (inverse function of tangent), gives argument in degrees

Parameters:
x - argument
Returns:
angle in degrees

atan2d

public static final double atan2d(double y,
                                  double x)
get the polar angle from 2-D cartesian coordinates

Parameters:
y - cartesian y coordinate
x - cartesian x coordinate
Returns:
polar angle in degrees

cosh

public static final double cosh(double x)
Hyperbolic cosine cosh = (exp(x) + exp(-x))/2

Parameters:
x - argument
Returns:
corresponding hyperbolic cosine (>= 1)

tanh

public static final double tanh(double x)
Hyperbolic tangent = (exp(x)-exp(-x))/(exp(x)+exp(-x))

Parameters:
x - argument
Returns:
corresponding hyperbolic tangent (in range ]-1, 1[)

atanh

public static final double atanh(double x)
tanh-1 (inverse function of tanh)

Parameters:
x - argument, in range ]-1, 1[ (NaN returned otherwise)
Returns:
corresponding hyperbolic inverse tangent

sinc

public static final double sinc(double x)
Function sinc(x) = sin(x)/x

Parameters:
x - argument (radians)
Returns:
corresponding value

asinc

public static final double asinc(double x)
Function asinc(x), inverse function of sinc

Parameters:
x - argument
Returns:
y such that sinc(y) = x

dexp

public static final double dexp(int n)
Compute just 10n

Parameters:
n - Power to which to compute the value
Returns:
10n

dexp

public static final double dexp(double x)
Compute just 10x

Parameters:
x - Power to which to compute the value
Returns:
10x

log

public static final double log(double x)
Compute the log base 10

Parameters:
x - Number (positive)
Returns:
log10(x)

ell1

public static final double ell1(double a,
                                double b)
Computation of complete elliptic integral of first kind. E1(a,b) = Integral{0,π/2} du/sqrt(a2cos2u+b2sin2u).
Computed with arithmetico-geometrical mean M(a,b) = common limit of an+1=(an+bn)/2, bn+1=sqrt(an*bn).
The arithmetico-geometrical mean M(a,b) is given by (Gauss): 1/M(a,b) = (2/π) E1(a,b)

Parameters:
a - factor 'a' (must be positive, a>0)
b - factor 'b' (must be positive, b>0)
Returns:
value of the elliptic integral function.

m3p

public static final double[][] m3p(double[][] A,
                                   double[][] B)
3-Matrices Products

Parameters:
A - 3x3 matrix
B - 3x3 matrix
Returns:
R = A * B

m3t

public static final double[][] m3t(double[][] A)
Transposed of a Matrix

Parameters:
A - input matric
Returns:
R = t(A)