public class Math extends Object
Math operations.
By default, Math methods will be used by all other JOML classes. In order to use the approximations in this class, start the JVM with the parameter -Djoml.fastmath.
There are two algorithms for approximating sin/cos:
-Djoml.sinLookup. The lookup table bit length of the second algorithm can also be adjusted
for improved accuracy via -Djoml.sinLookup.bits=<n>, where <n> is the number of bits of the lookup table.| Modifier and Type | Field and Description |
|---|---|
static double |
PI |
| Constructor and Description |
|---|
Math() |
| Modifier and Type | Method and Description |
|---|---|
static double |
abs(double r) |
static float |
abs(float r) |
static int |
abs(int r) |
static double |
acos(double r) |
static double |
asin(double r) |
static double |
atan2(double y,
double x) |
static double |
ceil(double v) |
static float |
ceil(float v) |
static double |
cos(double rad) |
static double |
cosFromSin(double sin,
double angle) |
static double |
exp(double a) |
static double |
floor(double v) |
static float |
floor(float v) |
static boolean |
isFinite(double d) |
static boolean |
isFinite(float f) |
static double |
max(double a,
double b) |
static float |
max(float a,
float b) |
static int |
max(int x,
int y) |
static double |
min(double a,
double b) |
static float |
min(float a,
float b) |
static int |
min(int x,
int y) |
static long |
round(double v) |
static int |
round(float v) |
static double |
sin(double rad) |
static double |
sqrt(double r) |
static double |
tan(double r) |
static double |
toDegrees(double angles) |
static double |
toRadians(double angles) |
public static final double PI
public static double sin(double rad)
public static double cos(double rad)
public static double cosFromSin(double sin,
double angle)
public static double sqrt(double r)
public static double tan(double r)
public static double acos(double r)
public static double atan2(double y,
double x)
public static double asin(double r)
public static double abs(double r)
public static float abs(float r)
public static int abs(int r)
public static int max(int x,
int y)
public static int min(int x,
int y)
public static float min(float a,
float b)
public static float max(float a,
float b)
public static double min(double a,
double b)
public static double max(double a,
double b)
public static double toRadians(double angles)
public static double toDegrees(double angles)
public static double floor(double v)
public static float floor(float v)
public static double ceil(double v)
public static float ceil(float v)
public static long round(double v)
public static int round(float v)
public static double exp(double a)
public static boolean isFinite(double d)
public static boolean isFinite(float f)
Copyright © 2015–2019 JOML. All rights reserved.