uk.ac.starlink.ttools.func
Class Maths

java.lang.Object
  extended by uk.ac.starlink.ttools.func.Maths

public class Maths
extends Object

Standard mathematical and trigonometric functions.

Since:
2 Sep 2004
Author:
Mark Taylor (Starlink)

Field Summary
static double E
          Euler's number e, the base of natural logarithms.
static double PI
          Pi, the ratio of the circumference of a circle to its diameter.
static double RANDOM
          Evaluates to a random number in the range 0<=x<1.
 
Method Summary
static double acos(double x)
          Arc cosine of an angle.
static double acosh(double x)
          Inverse hyperbolic cosine.
static double asin(double x)
          Arc sine of an angle.
static double asinh(double x)
          Inverse hyperbolic sine.
static double atan(double x)
          Arc tangent of an angle.
static double atan2(double y, double x)
          Converts rectangular coordinates (x,y) to polar (r,theta).
static double atanh(double x)
          Inverse hyperbolic tangent.
static double cos(double theta)
          Cosine of an angle.
static double cosh(double x)
          Hyperbolic cosine.
static double exp(double x)
          Euler's number e raised to a power.
static double ln(double x)
          Natural logarithm.
static double log10(double x)
          Logarithm to base 10.
static double pow(double a, double b)
          Exponentiation.
static double sin(double theta)
          Sine of an angle.
static double sinh(double x)
          Hyperbolic sine.
static double sqrt(double x)
          Square root.
static double tan(double theta)
          Tangent of an angle.
static double tanh(double x)
          Hyperbolic tangent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

E

public static final double E
Euler's number e, the base of natural logarithms.

See Also:
Constant Field Values

PI

public static final double PI
Pi, the ratio of the circumference of a circle to its diameter.

See Also:
Constant Field Values

RANDOM

public static final double RANDOM
Evaluates to a random number in the range 0<=x<1. This is different for each cell of the table. The quality of the randomness may not be particularly good.

See Also:
Constant Field Values
Method Detail

sin

public static double sin(double theta)
Sine of an angle.

Parameters:
theta - an angle, in radians.
Returns:
the sine of the argument.

cos

public static double cos(double theta)
Cosine of an angle.

Parameters:
theta - an angle, in radians.
Returns:
the cosine of the argument.

tan

public static double tan(double theta)
Tangent of an angle.

Parameters:
theta - an angle, in radians.
Returns:
the tangent of the argument.

asin

public static double asin(double x)
Arc sine of an angle. The result is in the range of -pi/2 through pi/2.

Parameters:
x - the value whose arc sine is to be returned.
Returns:
the arc sine of the argument (radians)

acos

public static double acos(double x)
Arc cosine of an angle. The result is in the range of 0.0 through pi.

Parameters:
x - the value whose arc cosine is to be returned.
Returns:
the arc cosine of the argument (radians)

atan

public static double atan(double x)
Arc tangent of an angle. The result is in the range of -pi/2 through pi/2.

Parameters:
x - the value whose arc tangent is to be returned.
Returns:
the arc tangent of the argument (radians)

exp

public static double exp(double x)
Euler's number e raised to a power.

Parameters:
x - the exponent to raise e to.
Returns:
the value ex, where e is the base of the natural logarithms.

log10

public static double log10(double x)
Logarithm to base 10.

Parameters:
x - argument
Returns:
log10(x)

ln

public static double ln(double x)
Natural logarithm.

Parameters:
x - argument
Returns:
loge(x)

sqrt

public static double sqrt(double x)
Square root. The result is correctly rounded and positive.

Parameters:
x - a value.
Returns:
the positive square root of x. If the argument is NaN or less than zero, the result is NaN.

atan2

public static double atan2(double y,
                           double x)
Converts rectangular coordinates (x,y) to polar (r,theta). This method computes the phase theta by computing an arc tangent of y/x in the range of -pi to pi.

Parameters:
y - the ordinate coordinate
x - the abscissa coordinate
Returns:
the theta component (radians) of the point (r,theta) in polar coordinates that corresponds to the point (x,y) in Cartesian coordinates.

pow

public static double pow(double a,
                         double b)
Exponentiation. The result is the value of the first argument raised to the power of the second argument.

Parameters:
a - the base.
b - the exponent.
Returns:
the value ab.

sinh

public static double sinh(double x)
Hyperbolic sine.

Parameters:
x - parameter
Returns:
result

cosh

public static double cosh(double x)
Hyperbolic cosine.

Parameters:
x - parameter
Returns:
result

tanh

public static double tanh(double x)
Hyperbolic tangent.

Parameters:
x - parameter
Returns:
result

asinh

public static double asinh(double x)
Inverse hyperbolic sine.

Parameters:
x - parameter
Returns:
result

acosh

public static double acosh(double x)
Inverse hyperbolic cosine.

Parameters:
x - parameter
Returns:
result

atanh

public static double atanh(double x)
Inverse hyperbolic tangent.

Parameters:
x - parameter
Returns:
result


Copyright © 2009 Central Laboratory of the Research Councils. All Rights Reserved.