|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jv.vecmath.PuMath
Mathematical utility functions extending java.lang.Math.
Math| Field Summary | |
static double |
EPS
Numerical machine accuracy, e.g. used to check for zero and as stopping criterium. |
static double |
GOLD
Ratio of the golden section GOLD = 2/(sqrt(5)-1). |
| Constructor Summary | |
PuMath()
|
|
| Method Summary | |
static double |
acosh(double x)
Mathematical acosh(x)=ln(x+sqrt(x*x-1)) function. |
static double |
acoth(double x)
Mathematical acoth(x) = ln((1.+x)/(x-1.))/2. function. |
static boolean |
angle(double[] agl,
double a,
double b,
double c)
Return all three angles opposite to sides of triangle with given side lengths. |
static double |
angle(double a,
double b,
double c)
Return angle opposite to side a of triangle with given side lengths. |
static double |
area(double a,
double b,
double c)
Return area of triangle with given side lengths. |
static double |
asinh(double x)
Mathematical asinh(x)=ln(x+sqrt(x*x+1)) function. |
static double |
atanh(double x)
Mathematical atanh(x) = ln((1.+x)/(1.-x))/2. function. |
static double |
binom(int n,
int k)
Return binomial coefficients n over k. |
static double |
cosh(double x)
Mathematical cosh(x) function. |
static double |
coth(double x)
Mathematical coth(x) function. |
static void |
ctg(double[] ctg,
double a,
double b,
double c)
Return cot() of all three angles opposite to sides of triangle
with given side lengths. |
static double |
ctg(double a,
double b,
double c)
Return cot(alpha) of angle opposite to side a of triangle with given side lengths. |
static double |
dist(double[] v,
double[] w)
Return distance between two vectors given as double arrays. |
static double |
dot(double[] v,
double[] w)
Return dot product of two vectors given as double arrays. |
static int |
factorial(int n)
Return faculty n! |
static int |
gcd(int m,
int n)
Compute the greatest common divisor of two integers m and n. |
static void |
heapsort(int n,
double[] arrin,
int[] indx)
New heapsort has index counting starts at 0 instead of previous NR-type at 1. |
static void |
heapsort(int n,
int[] arrin,
int[] indx)
New heapsort has index counting starts at 0 instead of previous NR-type at 1. |
static double |
log(double basis,
double arg)
Return logarithm with respect to given basis. |
static void |
main(java.lang.String[] args)
Main method to test heapsort method |
static void |
projectOnto(double[] v,
double[] dir)
Project vector v onto line dir and store result in v.
|
static int |
sign(double x)
Return sign of argument as integer value. |
static double |
sign(double a,
double b)
Return first argument with sign of second argument. |
static double |
sinh(double x)
Mathematical sinh(x) function. |
static double |
sqrDist(double[] v,
double[] w)
Return square distance between two vectors given as double arrays. |
static double |
tanh(double x)
Mathematical tanh(x) function. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final double EPS
public static final double GOLD
GOLD = 2/(sqrt(5)-1).| Constructor Detail |
public PuMath()
| Method Detail |
public static int sign(double x)
public static double sign(double a,
double b)
public static double log(double basis,
double arg)
public static double sinh(double x)
sinh(x) function.public static double cosh(double x)
cosh(x) function.public static double tanh(double x)
tanh(x) function.public static double coth(double x)
coth(x) function.public static double asinh(double x)
asinh(x)=ln(x+sqrt(x*x+1)) function.public static double acosh(double x)
acosh(x)=ln(x+sqrt(x*x-1)) function.public static double atanh(double x)
atanh(x) = ln((1.+x)/(1.-x))/2. function.public static double acoth(double x)
acoth(x) = ln((1.+x)/(x-1.))/2. function.
public static double area(double a,
double b,
double c)
public static double angle(double a,
double b,
double c)
a of triangle with given side lengths.
public static boolean angle(double[] agl,
double a,
double b,
double c)
public static double ctg(double a,
double b,
double c)
cot(alpha) of angle opposite to side a of triangle with given side lengths.
public static void ctg(double[] ctg,
double a,
double b,
double c)
cot() of all three angles opposite to sides of triangle
with given side lengths.
public static void projectOnto(double[] v,
double[] dir)
v onto line dir and store result in v.
Both vectors given as double arrays.
public static double dot(double[] v,
double[] w)
public static double sqrDist(double[] v,
double[] w)
public static double dist(double[] v,
double[] w)
public static int factorial(int n)
n.
public static double binom(int n,
int k)
public static int gcd(int m,
int n)
public static void main(java.lang.String[] args)
public static final void heapsort(int n,
double[] arrin,
int[] indx)
public static final void heapsort(int n,
int[] arrin,
int[] indx)
|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||