Package org.joml
Class Math
- java.lang.Object
-
- org.joml.Math
-
public class Math extends Object
Contains fast approximations of someMathoperations.By default,
Mathmethods 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:
- arithmetic polynomial approximation contributed by roquendm
- theagentd's linear interpolation variant of Riven's algorithm from http://www.java-gaming.org/
-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.- Author:
- Kai Burjack
-
-
Field Summary
Fields Modifier and Type Field Description static doublePI
-
Constructor Summary
Constructors Constructor Description Math()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleabs(double r)static floatabs(float r)static intabs(int r)static doubleacos(double r)static doubleasin(double r)static doubleatan2(double y, double x)static doubleceil(double v)static floatceil(float v)static doublecos(double rad)static doublecosFromSin(double sin, double angle)static doubleexp(double a)static doublefloor(double v)static floatfloor(float v)static doublefma(double a, double b, double c)static floatfma(float a, float b, float c)static booleanisFinite(double d)static booleanisFinite(float f)static doublemax(double a, double b)static floatmax(float a, float b)static intmax(int x, int y)static doublemin(double a, double b)static floatmin(float a, float b)static intmin(int x, int y)static longround(double v)static intround(float v)static doublesafeAcos(double v)static doublesin(double rad)static doublesqrt(double r)static doubletan(double r)static doubletoDegrees(double angles)static doubletoRadians(double angles)
-
-
-
Field Detail
-
PI
public static final double PI
- See Also:
- Constant Field Values
-
-
Method Detail
-
sin
public static double sin(double rad)
-
cos
public static double cos(double rad)
-
cosFromSin
public static double cosFromSin(double sin, double angle)
-
sqrt
public static double sqrt(double r)
-
tan
public static double tan(double r)
-
acos
public static double acos(double r)
-
safeAcos
public static double safeAcos(double v)
-
atan2
public static double atan2(double y, double x)
-
asin
public static double asin(double r)
-
abs
public static double abs(double r)
-
abs
public static float abs(float r)
-
abs
public static int abs(int r)
-
max
public static int max(int x, int y)
-
min
public static int min(int x, int y)
-
min
public static float min(float a, float b)
-
max
public static float max(float a, float b)
-
min
public static double min(double a, double b)
-
max
public static double max(double a, double b)
-
toRadians
public static double toRadians(double angles)
-
toDegrees
public static double toDegrees(double angles)
-
floor
public static double floor(double v)
-
floor
public static float floor(float v)
-
ceil
public static double ceil(double v)
-
ceil
public static float ceil(float v)
-
round
public static long round(double v)
-
round
public static int round(float v)
-
exp
public static double exp(double a)
-
isFinite
public static boolean isFinite(double d)
-
isFinite
public static boolean isFinite(float f)
-
fma
public static float fma(float a, float b, float c)
-
fma
public static double fma(double a, double b, double c)
-
-