|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.math.MathUtil
MathUtil consists of various math related utility functions.
All provided methods are static.
| Method Summary | |
static double |
degtoRad(double degrees)
Converts the given angle in degree into the aquivalent angle in radians. |
static int |
fractAsInt(double intWithFrac)
Converts the fractional part of the real number given by d
into an int. |
static int |
gcd(int m,
int n)
Computes the greatest common divisor of two numbers. |
static long |
gcd(long m,
long n)
Computes the greatest common divisor of two numbers. |
static double |
mod(double divident,
double divisor)
Returns the remainder of a real number devision. |
static void |
mul(double[] vector,
Matrix44D matrix)
Multiplicates the components of the given vector with the components of the given matrix and writes the results back to the vector components. |
static void |
mul(Vector4 vector,
Matrix44D matrix)
Multiplicates the component of the given vector with the component of the given matrix and writes the results back to the vector components. |
static double[] |
pq(double a,
double b,
double c)
Solves a quadratic polynomial (degree = 2) of the form f(x) = ax^2 + bx + c using a numerically stable variant of the pq formula. |
static double |
radByVector(double dx,
double dy)
Calculates the angle in radians of the two dimensional vector given by its two components. |
static double |
radtoDeg(double radians)
Converts the given angle in radians into the aquivalent angle in degree This method is final. |
static void |
randomPermutation(int[] array)
Randomly shuffles an integer array in place. |
static void |
randomPermutation(java.lang.Object[] array)
Randomly shuffles an array in place. |
static double |
sign(double n)
Returns the sign of a value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final void randomPermutation(java.lang.Object[] array)
array - the array whose contents to shuffle in place.public static final void randomPermutation(int[] array)
array - the integer array whose contents to shuffle in place.
public static final long gcd(long m,
long n)
m - the first divident.n - the second divident.
public static final int gcd(int m,
int n)
m - the first number.n - the second number.
public static final double sign(double n)
n - the value whose sign is to be computed.
public static final double[] pq(double a,
double b,
double c)
NaN, if negative square
root(s) occur.
a - coefficient for x^2.b - coefficient for x^1.c - coefficient for x^0.
public static final void mul(Vector4 vector,
Matrix44D matrix)
vector - the vector to multiplicate.matrix - the matrix to multiplicate with.
public static final void mul(double[] vector,
Matrix44D matrix)
vector - the vector to multiplicate.matrix - the matrix to multiplicate with.
public static double mod(double divident,
double divisor)
divident - the divident.divisor - the divisor.
public static int fractAsInt(double intWithFrac)
d
into an int.
intWithFrac - a real number with fractional part.
public static final double degtoRad(double degrees)
degrees - angle in degrees.
public static final double radtoDeg(double radians)
java.lang.Math.toDegrees.
radians - angle in radians.
public static final double radByVector(double dx,
double dy)
dx - horizontal component of vectordy - vertical component of vector
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||