|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSciLib.Math.math
public final class math
This class contains some useful computation methods.
| Field Summary | |
|---|---|
static double |
Pi
The constant value Pi = 3.141592 |
| Constructor Summary | |
|---|---|
math()
|
|
| Method Summary | |
|---|---|
static double |
cuberoot(double x)
Compute cuberoot of a double x |
static double |
decibel(double x)
Compute decibel value of a double x. |
static double |
decibelToNumber(double x)
Compute the number from its decibel |
static double |
degreesToRadians(double theta)
convert the degrees to radians of an angle theta. |
static int |
gcd(int a,
int b)
Compute the greatest common divisor of a and b computed using iterative version of Euclid's algorithm |
static int |
GrayCode(int n)
Compute the Gray code of an integer n |
static int |
GrayCodeInv(int n)
Compute the inverse of Gray code n |
static boolean |
isPrime(int x)
Check if an integer number x is a prime number |
static int |
lcm(int a,
int b)
Compute the least common multiple of a and b |
static double |
log10(double x)
Compute log10(x) |
static double |
log2(double x)
Compute log2(x) |
static int |
nextPrime(int x)
Compute the least prime number > x |
static double |
polynomial(double[] coef,
double x)
Compute the value of a polynomial at a point x |
static double |
radiansToDegrees(double theta)
convert the radians to degrees of an angle theta. |
static double |
random(double a,
double b)
Compute a random number between a and b, a<=r |
static double |
random(double a,
double b,
int n)
Compute a random number between a and b, a<=r |
static double |
roundUp(double x)
RoundUp a double x to integer |
static double |
roundUp(double x,
int n)
RoundUp a double x to a double with n decimal digits |
static int |
sgn(double x)
Compute the signum of a double x |
static double |
sigmoid(double x)
Compute the value of a sigmoid function at a point x sigmoid(x) = 1 / (1 + exp(-x)) |
static double |
sigmoid2(double x)
Compute the value of a sigmoid function of type 2 at a point x sigmoid2(x) = 2*sigmoid(x) - 1 |
static double |
sinc(double x)
Compute sinc(x) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double Pi
| Constructor Detail |
|---|
public math()
| Method Detail |
|---|
public static double decibel(double x)
x - A double value
public static double decibelToNumber(double x)
x - A double value
public static double degreesToRadians(double theta)
theta - A double value
public static double radiansToDegrees(double theta)
theta - A double value
public static double log10(double x)
x - A double value
public static double log2(double x)
public static double polynomial(double[] coef,
double x)
coef - The array that contains all coefficients of the polynomialx - The value of variable
public static double roundUp(double x)
x - A double value
public static double roundUp(double x,
int n)
x - A double valuen - The number of decimal digits
public static double sinc(double x)
x - A double value
public static boolean isPrime(int x)
x - An integer value
public static int nextPrime(int x)
x - An integer value
public static int gcd(int a,
int b)
a - An integer value, a > 0b - An integer value, b > 0
public static int lcm(int a,
int b)
a - An integer value, a > 0b - An integer value, b > 0
public static int GrayCode(int n)
n - An integer value
public static int GrayCodeInv(int n)
n - An integer value
public static double random(double a,
double b)
a - A double valueb - A double value
public static double random(double a,
double b,
int n)
a - A double valueb - A double valuen - An integer
public static double sigmoid(double x)
x - A double value
public static double sigmoid2(double x)
x - A double value
public static double cuberoot(double x)
x - A double value
public static int sgn(double x)
x - A double value
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||