JSci.maths
Class ExtraMath

java.lang.Object
  extended by JSci.maths.AbstractMath
      extended by JSci.maths.ExtraMath

public final class ExtraMath
extends AbstractMath

The extra math library. Provides extra functions not in java.lang.Math class. This class cannot be subclassed or instantiated because all methods are static.

Version:
1.1
Author:
Mark Hale

Method Summary
static double acosh(double x)
          Returns the arc hyperbolic cosine of a double, in the range of 0.0 through infinity.
static double asinh(double x)
          Returns the arc hyperbolic sine of a double, in the range of -infinity through infinity.
static double atanh(double x)
          Returns the arc hyperbolic tangent of a double, in the range of -infinity through infinity.
static double binomial(double n, double k)
          Returns the binomial coefficient (n k).
static int binomial(int n, int k)
          Returns the binomial coefficient (n k).
static double cosh(double x)
          Returns the hyperbolic cosine of a double.
static double factorial(double x)
          Returns the factorial.
static double hypot(double x, double y)
          Returns sqrt(x2+y2).
static double logFactorial(double x)
          Returns the natural logarithm of the factorial.
static int pow(int a, int b)
          Returns ab.
static double sinh(double x)
          Returns the hyperbolic sine of a double.
static double tanh(double x)
          Returns the hyperbolic tangent of a double.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hypot

public static double hypot(double x,
                           double y)
Returns sqrt(x2+y2).


pow

public static int pow(int a,
                      int b)
Returns ab.


factorial

public static double factorial(double x)
Returns the factorial. (Wrapper for the gamma function).

Parameters:
x - a double.
See Also:
SpecialMath.gamma(double)

logFactorial

public static double logFactorial(double x)
Returns the natural logarithm of the factorial. (Wrapper for the log gamma function).

Parameters:
x - a double.
See Also:
SpecialMath.logGamma(double)

binomial

public static int binomial(int n,
                           int k)
Returns the binomial coefficient (n k). Uses Pascal's recursion formula.

Parameters:
n - an integer.
k - an integer.

binomial

public static double binomial(double n,
                              double k)
Returns the binomial coefficient (n k). Uses gamma functions.

Parameters:
n - a double.
k - a double.

sinh

public static double sinh(double x)
Returns the hyperbolic sine of a double.

Parameters:
x - a double.

cosh

public static double cosh(double x)
Returns the hyperbolic cosine of a double.

Parameters:
x - a double.

tanh

public static double tanh(double x)
Returns the hyperbolic tangent of a double.

Parameters:
x - a double.

asinh

public static double asinh(double x)
Returns the arc hyperbolic sine of a double, in the range of -infinity through infinity.

Parameters:
x - a double.

acosh

public static double acosh(double x)
Returns the arc hyperbolic cosine of a double, in the range of 0.0 through infinity.

Parameters:
x - a double.

atanh

public static double atanh(double x)
Returns the arc hyperbolic tangent of a double, in the range of -infinity through infinity.

Parameters:
x - a double.