|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.neu.ccs.util.MathUtilities
The class MathUtilities collects several useful
static mathematical functions. The class may be viewed as an
extension of the tools found in java.lang.Math.
| Constructor Summary | |
MathUtilities()
|
|
| Method Summary | |
static double |
acosdeg(double value)
Return the arc cosine in degrees of the specified input value in the range -1 to +1. |
static double |
asindeg(double value)
Return the arc sine in degrees of the specified input value in the range -1 to +1. |
static double |
atan2deg(double y,
double x)
Return the polar angle in degrees of the point (x, y) where the y-coordinate is given first and the x-coordinate second. |
static double |
atandeg(double value)
Return the arc tangent in degrees of the specified input value. |
static double |
cosdeg(double degrees)
Return the cosine of the given angle specified in degrees. |
static int |
GCD(int a,
int b)
Returns the greatest common divisor of the int inputs a and b. |
static long |
GCD(long a,
long b)
Returns the greatest common divisor of the long inputs a and b. |
static int |
LCM(int a,
int b)
Returns the least common multiple of the int inputs a and b. |
static long |
LCM(long a,
long b)
Returns the least common multiple of the long inputs a and b. |
static int |
modulus(int number,
int base)
Returns the modulus of int number relative to int base. |
static long |
modulus(long number,
long base)
Returns the modulus of long number relative to long base. |
static double |
randomDouble(double min,
double max)
Return a random double r in the range min <= r <= max. |
static int |
randomInt(int min,
int max)
Return a random int r in the range min <= r <= max. |
static double |
sindeg(double degrees)
Return the sine of the given angle specified in degrees. |
static double |
tandeg(double degrees)
Return the tangent of the given angle specified in degrees. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MathUtilities()
| Method Detail |
public static int randomInt(int min,
int max)
public static double randomDouble(double min,
double max)
public static double sindeg(double degrees)
public static double cosdeg(double degrees)
public static double tandeg(double degrees)
public static double asindeg(double value)
public static double acosdeg(double value)
public static double atandeg(double value)
public static double atan2deg(double y,
double x)
y - the y-coordinate of the pointx - the x-coordinate of the point
public static int GCD(int a,
int b)
Returns the greatest common divisor of the int inputs a and b.
The return value will be positive or zero and will be zero only if both a and b are zero.
public static long GCD(long a,
long b)
Returns the greatest common divisor of the long inputs a and b.
The return value will be positive or zero and will be zero only if both a and b are zero.
public static int LCM(int a,
int b)
Returns the least common multiple of the int inputs a and b.
The return value will be positive or zero and will be zero only if both a and b are zero.
public static long LCM(long a,
long b)
Returns the least common multiple of the long inputs a and b.
The return value will be positive or zero and will be zero only if both a and b are zero.
public static int modulus(int number,
int base)
Returns the modulus of int number relative to int base.
Returns n such that n is congruent to number modulo base and 0 <= n < Math.abs(base).
Throws ArithmeticException if base is zero.
public static long modulus(long number,
long base)
Returns the modulus of long number relative to long base.
Returns n such that n is congruent to number modulo base and 0 <= n < Math.abs(base).
Throws ArithmeticException if base is zero.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||