|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.nist.microanalysis.Utility.Math2
public class Math2
Useful math functions not provided in the standard libraries.
Copyright: Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain
Company: National Institute of Standards and Technology
| Field Summary | |
|---|---|
static double[] |
MINUS_X_AXIS
|
static double[] |
MINUS_Y_AXIS
|
static double[] |
MINUS_Z_AXIS
|
static double[] |
ORIGIN_3D
|
static double |
SQRT_PI
SQRT_PI - The square root of Pi ~ 1.772 |
static double[] |
X_AXIS
|
static double[] |
Y_AXIS
|
static double[] |
Z_AXIS
|
| Constructor Summary | |
|---|---|
Math2()
|
|
| Method Summary | |
|---|---|
static double |
angleBetween(double[] a,
double[] b)
angleBetween - Returns the angle between the vector a and vector b in radians. |
static double[] |
cross(double[] a,
double[] b)
cross - Computes the cross product of two three-vectors a and b |
static double |
distance(double[] p1,
double[] p2)
distance - What is the Euclidean distance between p1 and p2. |
static double[] |
divide(double[] a,
double b)
divide - Returns a vector containing a, a vector, divided by b, a scalar. |
static double |
dot(double[] a,
double[] b)
dot - Compute the dot product of two equal lengthed vectors |
static double |
erf(double x)
erf - The error function (2/sqrt(pi))*Integrate[Exp[-t^2],{t,0,x}] Source: Numerical Recipes in C - 2nd Edition |
static double |
erfc(double x)
erfc - The complementary error function (1-erf(x)) Source: Numerical Recipes in C - 2nd Edition |
static double |
expRand()
expRand - Selects a random value from an exponential distibution. |
static double |
gammaln(double xx)
gammaln - The natural log of the gamma function. |
static double |
gammap(double a,
double x)
gammap - Computes the incomplete gamma function P(a,x) by selecting between series and continued fraction representations based on the size of the arguments. |
static double |
li(double x)
li - A naive implementation of the Logarithmic Integral |
static double |
magnitude(double[] p)
magnitude - What is the length of the specified vector? |
static double[] |
minus(double[] a,
double[] b)
minus - Returns the vector sum a + b |
static double[] |
multiply(double a,
double[] b)
multiply - Returns a vector containing the product of a, a scalar, times b, a vector. |
static double[] |
negative(double[] a)
Returns a vector in which each of the coordinates equals -1 times the coordinates in a. |
static double[] |
normalize(double[] p)
normalize - Returns a copy of the input vector normalized to 1 length of 1.0. |
static double[] |
plus(double[] a,
double[] b)
plus - Returns the vector sum a + b |
static double |
sqr(double x)
sqr - returns x*x |
static double |
sum(double[] da)
sum - Returns the sum of the specified array |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double[] ORIGIN_3D
public static final double[] X_AXIS
public static final double[] Y_AXIS
public static final double[] Z_AXIS
public static final double[] MINUS_X_AXIS
public static final double[] MINUS_Y_AXIS
public static final double[] MINUS_Z_AXIS
public static final double SQRT_PI
| Constructor Detail |
|---|
public Math2()
| Method Detail |
|---|
public static final double sqr(double x)
x - double
public static final double erf(double x)
x - double
public static final double erfc(double x)
x - double
public static final double gammap(double a,
double x)
a - doublex - double
public static final double gammaln(double xx)
xx - double
public static final double expRand()
public static final double distance(double[] p1,
double[] p2)
p1 - p2 -
public static final double magnitude(double[] p)
p -
public static final double[] normalize(double[] p)
p - The vector to normalize
public static final double sum(double[] da)
da -
public static final double[] plus(double[] a,
double[] b)
a - b -
public static final double[] minus(double[] a,
double[] b)
a - b -
public static final double dot(double[] a,
double[] b)
a - b -
public static final double[] negative(double[] a)
a -
public static final double[] cross(double[] a,
double[] b)
a - b -
public static final double[] multiply(double a,
double[] b)
a - b -
public static final double angleBetween(double[] a,
double[] b)
a - b -
public static final double[] divide(double[] a,
double b)
a - b -
public static final double li(double x)
x -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||