public interface AQMath
Math contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions.
Functions
| Modifier and Type | Method and Description |
|---|---|
double |
abs(double value)
Returns the absolute value of a double value.
|
double |
acos(double value)
Returns the arc cosine of a value; the returned angle is in the range 0.0 through pi.
|
double |
asin(double value)
Returns the arc sine of a value; the returned angle is in the range -pi/2 through pi/2.
|
double |
atan(double value)
Returns the arc tangent of a value; the returned angle is in the range -pi/2 through pi/2.
|
double |
atan2(double x,
double y)
Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta).
|
double |
cbrt(double value)
Returns the cube root of a double value.
|
double |
ceil(double value)
Returns the smallest (closest to negative infinity) double value that is
greater than or equal to the argument and is equal to a mathematical integer.
|
double |
constrain(double value,
double min,
double max)
Constrains a value to not exceed a maximum and minimum value.
|
double |
copySign(double magnitude,
double sign)
Returns the first floating-point argument with the sign of the second floating-point argument.
|
double |
cos(double angle)
Returns the trigonometric cosine of an angle.
|
double |
cosh(double value)
Returns the hyperbolic cosine of a double value.
|
double |
exp(double power)
Returns Euler's number e raised to the power of a double value.
|
double |
expm1(double power)
Returns (e^x) - 1.
|
double |
factorial(int n)
Returns n!, the product of the numbers 1,...,n.
|
double |
floor(double value)
Returns the largest (closest to positive infinity) double value that is
less than or equal to the argument and is equal to a mathematical integer.
|
int |
gcd(int p,
int q)
Returns the greatest common divisor of the absolute value of two numbers,
using the "binary gcd" method which avoids division and modulo operations.
|
AQCurve |
getCurve() |
double |
getE()
Returns the double value that is closer than any other to e, the base of the natural logarithms.
|
AQFinancial |
getFinancial() |
AQFit |
getFit() |
double |
getPI()
Returns the value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter.
|
AQStat |
getStat() |
int |
hash(double value)
Returns an integer hash code representing the given double value.
|
double |
hypot(double x,
double y)
Returns sqrt(x**2 + y**2) without intermediate overflow or underflow.
|
double |
IEEEremainder(double v1,
double v2)
Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard.
|
int |
lcm(int a,
int b)
Returns the least common multiple of the absolute value of two numbers, using the formula lcm(a,b) = (a / gcd(a,b)) * b.
|
double |
log(double value)
Returns the natural logarithm (base e) of a double value.
|
double |
log10(double value)
Returns the base 10 logarithm of a double value.
|
double |
log1p(double value)
Returns the natural logarithm of the sum of the argument and 1.
|
double |
max(double v1,
double v2)
Returns the greater of two double values.
|
double |
min(double v1,
double v2)
Returns the smaller of two double values.
|
double |
nextAfter(double start,
double direction)
Returns the floating-point number adjacent to the first argument in the direction of the second argument.
|
double |
nextUp(double d)
Returns the floating-point value adjacent to d in the direction of positive infinity.
|
double |
norm(double value,
double low,
double high)
Normalizes a number from another range into a value between 0 and 1.
|
double |
pow(double a,
double b)
Returns the value of the first argument raised to the power of the second argument.
|
double |
random()
Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0.
|
double |
rint(double value)
Returns the double value that is closest in value to the argument and is equal to a mathematical integer.
|
long |
round(double value)
Returns the closest long to the argument.
|
double |
scalb(double d,
int scaleFactor)
Return d x 2**scaleFactor rounded as if performed by a single correctly rounded floating-point multiply to a member of the double value set.
|
double |
signum(double d)
Returns the signum function of the argument; zero if the argument is zero, 1.0 if the argument is greater than zero,
-1.0 if the argument is less than zero.
|
double |
sin(double angle)
Returns the trigonometric sine of an angle.
|
double |
sinh(double value)
Returns the hyperbolic sine of a double value.
|
double |
sqrt(double value)
Returns the correctly rounded positive square root of a double value.
|
double |
tan(double angle)
Returns the trigonometric tangent of an angle.
|
double |
tanh(double value)
Returns the hyperbolic tangent of a double value.
|
double |
toDegrees(double radians)
Converts an angle measured in radians to an approximately equivalent angle measured in degrees.
|
double |
toRadians(double degrees)
Converts an angle measured in degrees to an approximately equivalent angle measured in radians.
|
double |
ulp(double d)
Returns the size of an ulp of the argument.
|
AQStat getStat()
AQFinancial getFinancial()
AQCurve getCurve()
AQFit getFit()
double abs(double value)
value - The value to use in the computation; required.double cbrt(double value)
value - The value to use in the computation; required.double ceil(double value)
value - The value to use in the computation; required.double constrain(double value,
double min,
double max)
value - The value to use in the computation; required.min - The minimum value; required.max - The maximum value; required.double copySign(double magnitude,
double sign)
magnitude - The parameter providing the magnitude of the result.sign - The parameter providing the sign of the result.double exp(double power)
power - The exponent to raise e to.double expm1(double power)
power - The exponent to raise e to in the computation of e^x -1.double factorial(int n)
n - A integer to use in the computation.double floor(double value)
value - The value to use in the computation; required.int gcd(int p,
int q)
p - A non-zero number; required;q - A non-zero number; required;double getE()
int hash(double value)
value - The value to be hashed; required.double hypot(double x,
double y)
x - A value; requiredy - A value; required;double IEEEremainder(double v1,
double v2)
v1 - The dividend.v2 - The divisor.int lcm(int a,
int b)
a - The first integer value.b - The second integer value.double log(double value)
value - A value; required.value), the natural logarithm of value.double log10(double value)
value - A value; required.value.double log1p(double value)
value - A value; required.double max(double v1,
double v2)
v1 - A value.v2 - Another value.double min(double v1,
double v2)
v1 - A value.v2 - Another value.double nextAfter(double start,
double direction)
start - The starting floating-point value.direction - The value indicating which of start's neighbors or start should be returneddirection.double nextUp(double d)
d - The starting floating-point value.double norm(double value,
double low,
double high)
value - Valuelow - Lowhigh - Highdouble pow(double a,
double b)
a - The base.b - The exponent.a^bdouble random()
double rint(double value)
value - A double value.long round(double value)
value - A floating-point value to be rounded to an integer.double scalb(double d,
int scaleFactor)
d - The number to be scaled by a power of two.scaleFactor - power of 2 used to scale dd x 2^scaleFactordouble signum(double d)
d - The floating-point value whose signum is to be returned.double sqrt(double value)
value - A value.a. If the argument is NaN or less than zero, the result is NaN.double ulp(double d)
d - The floating-point value whose ulp is to be returned.double getPI()
double acos(double value)
value - The value whose arc cosine is to be returned.double asin(double value)
value - The value whose arc sine is to be returned.double atan(double value)
value - The value whose arc tangent is to be returned.double atan2(double x,
double y)
x - The ordinate coordinate.y - The abscissa coordinate.double cos(double angle)
angle - An angle, in radians.double cosh(double value)
value - The number whose hyperbolic cosine is to be returned.value.double sin(double angle)
angle - An angle, in radians.double sinh(double value)
value - The number whose hyperbolic sine is to be returned.value.double tan(double angle)
angle - An angle, in radians.double tanh(double value)
value - The number whose hyperbolic tangent is to be returned.value.double toDegrees(double radians)
radians - An angle, in radians.radians in degrees.double toRadians(double degrees)
degrees - An angle, in degrees.degrees in radians.
Copyright © 2019 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.