public final class Math
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
EPSILON |
static double |
FOUR_OVER_PI |
static double |
HALF_PI |
static double |
LOG2 |
static double |
ONE_FOURTH |
static double |
ONE_OVER_2PI |
static double |
ONE_OVER_PI |
static double |
ONE_THIRD |
static double |
PI |
static double |
PI_OVER_FOUR |
static double |
SQRT2 |
static double |
SQRT2_INV |
static double |
SQRT3 |
static double |
SQRT3_INV |
static double |
SQRT6 |
static double |
TWO_OVER_PI |
static double |
TWO_PI |
Constructor and Description |
---|
Math() |
Modifier and Type | Method and Description |
---|---|
static double |
abs(double a) |
static double |
acos(double a) |
static double |
asin(double a) |
static double |
asinc(double a)
Returns the inverse of the cardinal sine function of the given argument,
i.e. the inverse of sin(x) / x.
|
static double |
asincP(double a)
Same as
asinc(double) but assuming the argument is positive. |
static double |
atan2(double y,
double x) |
static double |
atanh(double x)
Returns tanh-1(x), i.e. the inverse function of tanh.
|
static double |
cos(double a) |
static boolean |
isFinite(double v) |
static double |
log(double x) |
static double |
oneMinusSin(double a)
To be used when sin(a) is near from 1 and a high precision is needed on 1 - sin(a).
|
static double |
pow(double a,
double b) |
static int |
roots(double q0,
double q1,
double q2,
double[] result)
Compute the number of real roots of the quadratic equation:
q2*x^2 + q1*x + q0 = 0
|
static int |
roots(double q0,
double q1,
double q2,
double q3,
double[] result) |
static long |
round(double a) |
static int |
round(float a) |
static double |
signum(double a) |
static double |
sin(double a) |
static double |
sinc(double a)
Returns the cardinal sine function of the given angle, i.e. sin(x) / x.
|
static double |
sincP(double a)
Same as
sinc(double) but assuming the argument is positive. |
static double |
sqrt(double angleRadians) |
static double |
sqrtOfOneMinusSin(double a)
To be used when sin(a) is near from 1 and a high precision is needed on sqrt(1 - sin(a)).
|
static double |
sqrtOfOneMinusSinPC(double a)
Same as
sqrtOfOneMinusSin(double) but limited to angle having a positive cosine
(in practice cos(a/2 + PI/2) must be positive). |
static double |
tan(double a) |
static double |
tanh(double x) |
static double |
toDegrees(double a) |
static double |
toRadians(double a) |
public static final double EPSILON
public static final double ONE_THIRD
public static final double ONE_FOURTH
public static final double PI
public static final double HALF_PI
public static final double PI_OVER_FOUR
public static final double TWO_PI
public static final double ONE_OVER_PI
public static final double ONE_OVER_2PI
public static final double TWO_OVER_PI
public static final double FOUR_OVER_PI
public static final double LOG2
public static final double SQRT2
public static final double SQRT2_INV
public static final double SQRT3
public static final double SQRT3_INV
public static final double SQRT6
public static boolean isFinite(double v)
public static double toRadians(double a)
public static double toDegrees(double a)
public static double abs(double a)
public static double signum(double a)
public static int round(float a)
public static long round(double a)
public static double pow(double a, double b)
public static double cos(double a)
public static double sin(double a)
public static double oneMinusSin(double a)
a
- angle in radianspublic static double sqrtOfOneMinusSin(double a)
oneMinusSin(double)
.a
- angle in radians HAVING a POSITIVE COSINE.public static double sqrtOfOneMinusSinPC(double a)
sqrtOfOneMinusSin(double)
but limited to angle having a positive cosine
(in practice cos(a/2 + PI/2) must be positive).a
- angle in radians HAVING a POSITIVE COSINE, or more generally, a in [-3pi/2, pi/2].public static double tan(double a)
public static double sinc(double a)
a
- angle in radianspublic static double sincP(double a)
sinc(double)
but assuming the argument is positive.
Precision of 10e-16 on small angles.a
- angle we are looking for the sine, must be > 0.public static double acos(double a)
public static double asin(double a)
public static double asinc(double a)
a
- argumentpublic static double asincP(double a)
asinc(double)
but assuming the argument is positive.a
- argumentpublic static double atan2(double y, double x)
public static double tanh(double x)
public static double atanh(double x)
x
- argument, in range ]-1, 1[ (NaN returned otherwise)public static double log(double x)
public static double sqrt(double angleRadians)
public static int roots(double q0, double q1, double q2, double[] result)
q0
- coefficient of x^0q1
- coefficient of x^1q2
- coefficient of x^2result
- arrays of size at least 2 storing the real roots (if any)public static int roots(double q0, double q1, double q2, double q3, double[] result)
Copyright © 2018 F.-X. Pineau, CDS, Observatoire Astronomique de Strasbourg, Universite de Strasbourg, CNRS. All Rights Reserved.