|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmath.MathUtils
public class MathUtils
Field Summary | |
---|---|
static double |
DEG_2_RAD
Constant to convert degrees to radians. |
static double |
LOG2
|
static double |
PI
|
static double |
PI_ON_180
|
static double |
PI_ON_2
|
static double |
PI_ON_4
|
static double |
RAD_2_DEG
Constant to convert radians to degrees. |
Constructor Summary | |
---|---|
MathUtils()
|
Method Summary | |
---|---|
static double |
acosd(double a)
Returns the inverse cosine of a value, in the range of 0.0 through 180.0 degrees. |
static double |
acosh(double a)
Returns the inverse hyperbolic cosine of a value. |
static double |
asind(double a)
Returns the inverse sine of a value, in the range of -90.0 through 90.0 degrees. |
static double |
asinh(double a)
Returns the inverse hyperbolic sine of a value. |
static int |
atan(int y,
int x)
|
static double |
atan2d(double a,
double b)
Calculates the angle from the positive horizontal (x-)axis to a point (a,b), in the range of -180.0 through 180.0 degrees. |
static double |
atand(double a)
Returns the inverse tangent of a value, in the range of -90.0 through 90.0 degrees. |
static double |
atanh(double a)
Returns the inverse hyperbolic tangent of a value. |
static short |
clip(short i)
|
static boolean |
closeEnough(double x,
double y,
double percentage)
|
static double |
cos(double alpha)
|
static double |
cosd(double a)
Returns the cosine of an angle expressed in degrees. |
static double |
cosh(double a)
Returns the hyperbolic cosine of an angle. |
static double |
factorial(int n)
|
static float |
factorial(short n)
|
static int |
fib(int n)
|
static int |
gcd(int a,
int b)
|
static double |
getGauss(double x,
double xc,
double sigma)
|
static double[] |
getGauss(int n)
|
static double |
getLOG2()
|
static int |
getLogBase2(double d)
|
static double |
getLogBase2Double(double d)
|
static double |
getRandom(double min,
double max)
|
static int |
getRandomNumber0_255()
|
static double |
getTrapezoidal(double x,
double a,
double b,
double c,
double d)
|
static boolean |
isOdd(int i)
|
static boolean |
isPowerOfTwo(double l)
|
static int |
isqrt(int x)
|
static short |
isqrt(short x)
|
static double |
log10(double a)
Returns the logarithm to the base 10 of a number. |
static double |
log2(double l)
|
static int |
log2(int l)
|
static double |
logBase2(int length)
|
static double |
logBase4(int length)
|
static void |
main(java.lang.String[] args)
|
static double |
max(int x,
int y)
|
static boolean |
nextTo(int x0,
int y0,
int x1,
int y1)
|
static boolean |
onLine(int x0,
int y0,
int x1,
int y1,
int x2,
int y2)
|
static void |
print(double[] d)
|
static int |
roundToIntegralPowerOf2(int n)
|
static int |
sign(int x)
|
static double |
sin(double alpha)
|
static double |
sinc(double x)
Returns the function sinc x, where sinc x is defined as sin x / x. |
static double |
sind(double a)
Returns the sine of an angle expressed in degrees. |
static double |
sinh(double a)
Returns the hyperbolic sine of an angle. |
static float |
sqrt(double f)
|
static float |
sqrt(float f)
|
static double |
tand(double a)
Returns the tangent of an angle expressed in degrees. |
static double |
tanh(double a)
Returns the hyperbolic tangent of an angle. |
static void |
testCloseEnough()
|
static void |
testGauss()
|
static void |
testLongIsqrt()
|
static void |
writeOutRandomNumbersToAFile()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double LOG2
public static final double PI_ON_180
public static final double PI
public static final double PI_ON_2
public static final double PI_ON_4
public static final double DEG_2_RAD
public static final double RAD_2_DEG
Constructor Detail |
---|
public MathUtils()
Method Detail |
---|
public static void writeOutRandomNumbersToAFile()
public static boolean isOdd(int i)
public static int getLogBase2(double d)
d
- input argument to the log2 function
public static double getLogBase2Double(double d)
public static double getGauss(double x, double xc, double sigma)
public static double[] getGauss(int n)
public static void testGauss()
public static final void print(double[] d)
public static void testLongIsqrt()
public static short isqrt(short x)
public static int isqrt(int x)
public static int roundToIntegralPowerOf2(int n)
public static double getTrapezoidal(double x, double a, double b, double c, double d)
public static int gcd(int a, int b)
public static int log2(int l)
public static double getLOG2()
public static double log2(double l)
public static boolean isPowerOfTwo(double l)
public static int sign(int x)
public static double cos(double alpha)
public static double sin(double alpha)
public static int atan(int y, int x)
public static boolean nextTo(int x0, int y0, int x1, int y1)
public static boolean onLine(int x0, int y0, int x1, int y1, int x2, int y2)
public static double max(int x, int y)
public static float sqrt(float f)
public static float sqrt(double f)
public static double logBase2(int length)
public static double logBase4(int length)
public static int fib(int n)
public static double acosd(double a)
a
- input value in the range -1.0 <= a <= 1.0.
public static double acosh(double a)
a
- input value in the range a >= 1.0.
public static double asind(double a)
a
- input value in the range -1.0 <= a <= 1.0.
public static double asinh(double a)
a
- input value
public static double atand(double a)
a
- input value
public static double atanh(double a)
a
- input value
public static double atan2d(double a, double b)
a
- x-input valuea
- y-input value
public static double cosd(double a)
a
- an angle, in degrees.
public static double cosh(double a)
a
- an angle, in radians.
public static double log10(double a)
a
- a double
value
public static double sinc(double x)
x
- input value.
public static double sind(double a)
a
- an angle, in degrees.
public static double sinh(double a)
a
- an angle, in radians.
public static double tand(double a)
a
- an angle, in degrees.
public static double tanh(double a)
a
- an angle, in radians.
public static int getRandomNumber0_255()
public static double getRandom(double min, double max)
min
- rangemax
- range
public static short clip(short i)
public static boolean closeEnough(double x, double y, double percentage)
public static void testCloseEnough()
public static double factorial(int n)
public static float factorial(short n)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |