|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JSci.maths.AbstractMath JSci.maths.ExtraMath
public final class ExtraMath
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.
Method Summary | |
---|---|
static double |
acosh(double x)
Returns the inverse hyperbolic cosine of a double value. |
static double |
acoth(double x)
Returns the inverse hyperbolic cotangent of a double value. |
static double |
acsch(double x)
Returns the inverse hyperbolic cosecant of a double value. |
static double |
asech(double x)
Returns the inverse hyperbolic secant of a double value. |
static double |
asinh(double x)
Returns the inverse hyperbolic sine of a double value. |
static double |
atanh(double x)
Returns the inverse hyperbolic tangent of a double value. |
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 |
coth(double x)
Returns the hyperbolic cotangent of a double value. |
static double |
csch(double x)
Returns the hyperbolic cosecant of a double value. |
static double |
factorial(double x)
Returns the factorial. |
static double |
hypot(double x,
double y)
Returns sqrt(x2+y2). |
static double |
log10(double x)
Returns the base 10 logarithm of a double. |
static double |
logFactorial(double x)
Returns the natural logarithm of the factorial. |
static int |
pow(int a,
int b)
Returns ab. |
static int |
pow2(int a)
Returns 2a. |
static double |
random(double min,
double max)
Returns a random number within a specified range. |
static double |
round(double x,
int significant)
Rounds a number to so many significant figures. |
static double |
sech(double x)
Returns the hyperbolic secant of a double value. |
static int |
sign(double x)
Returns the sign of a number. |
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 |
---|
public static double round(double x, int significant)
x
- a number to be rounded.significant
- number of significant figures to round to.public static double random(double min, double max)
public static int sign(double x)
public static double hypot(double x, double y)
public static int pow(int a, int b)
a
- an integer.b
- a positive integer.public static int pow2(int a)
a
- a positive integer.public static double factorial(double x)
x
- a double.SpecialMath.gamma(double)
public static double logFactorial(double x)
x
- a double.SpecialMath.logGamma(double)
public static int binomial(int n, int k)
n
- an integer.k
- an integer.public static double binomial(double n, double k)
n
- a double.k
- a double.public static double log10(double x)
x
- a double.public static double sinh(double x)
x
- a double.public static double cosh(double x)
x
- a double.public static double tanh(double x)
x
- a double.public static double coth(double x)
double
value.
The identity is:
coth(x) = (ex + e-x)/(ex - e-x), in other words, cosh(x)/sinh(x).
Special cases:
+1.0
.
-1.0
.
x
- The number whose hyperbolic cotangent is sought
x
public static double csch(double x)
double
value.
The identity is:
csch(x) = (2/(ex - e-x), in other words, 1/sinh(x).
Special cases:
+0.0
.
-0.0
.
x
- The number whose hyperbolic cosecant is sought
x
public static double sech(double x)
double
value.
The identity is:
sech(x) = (2/(ex + e-x), in other words, 1/cosh(x).
Special cases:
+0.0
.
x
- The number whose hyperbolic secant is sought
x
public static double asinh(double x)
double
value.
The identity is:
asinh(x) = ln(x + sqrt(x2 + 1))
Special cases:
x
- The number whose inverse hyperbolic sine is sought
x
public static double acosh(double x)
double
value.
Note that cosh(±acosh(x)) = x; this function arbitrarily returns the positive branch.
The identity is:
acosh(x) = ln(x ± sqrt(x2 - 1))
Special cases:
x
- The number whose inverse hyperbolic cosine is sought
x
public static double atanh(double x)
double
value.
The identity is:
atanh(x) = (1/2)*ln((1 + x)/(1 - x))
Special cases:
x
- A double specifying the value whose inverse hyperbolic tangent is sought
public static double acoth(double x)
double
value.
The identity is:
acoth(x) = (1/2)*ln((x + 1)/(x - 1))
Special cases:
x
- The number whose inverse hyperbolic cotangent is sought
x
public static double acsch(double x)
double
value.
The identity is:
acsch(x) = ln((1 - sqrt(1 + x2))/x) for x < 0;
acsch(x) = ln((1 + sqrt(1 + x2))/x) for x > 0.
Special cases:
x
- The number whose inverse hyperbolic cosecant is sought
x
public static double asech(double x)
double
value.
Note that sech(±asech(x)) = x; this function arbitrarily returns the positive branch.
The identity is:
asech(x) = ln((1 + sqrt(1 - x2))/x).
Special cases:
x
- The number whose hyperbolic secant is sought
x
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |