Class Mathf
- java.lang.Object
-
- WildMagic.LibFoundation.Mathematics.Mathf
-
- All Implemented Interfaces:
java.io.Serializable
public final class Mathf extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static float
DEG_TO_RAD
static float
EPSILON
static float
HALF_PI
static float
INV_LN_10
static float
INV_LN_2
static float
INV_PI
static float
LN_10
static float
LN_2
static float
RAD_TO_DEG
private static long
serialVersionUID
static float
SQRT2
static float
TWO_PI
static float
ZERO_TOLERANCE
-
Constructor Summary
Constructors Constructor Description Mathf()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
InvSqrt(double fValue)
Calculation of 1/sqrt(fValue)static float
InvSqrt(float fValue)
Calculation of 1/sqrt(fValue)static float
Log2(float fValue)
static float
SymmetricRandom()
Generate a random number in [-1,1).static float
UnitRandom()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
ZERO_TOLERANCE
public static final float ZERO_TOLERANCE
- See Also:
- Constant Field Values
-
TWO_PI
public static final float TWO_PI
- See Also:
- Constant Field Values
-
HALF_PI
public static final float HALF_PI
- See Also:
- Constant Field Values
-
INV_PI
public static final float INV_PI
- See Also:
- Constant Field Values
-
DEG_TO_RAD
public static final float DEG_TO_RAD
- See Also:
- Constant Field Values
-
SQRT2
public static final float SQRT2
-
EPSILON
public static final float EPSILON
- See Also:
- Constant Field Values
-
RAD_TO_DEG
public static final float RAD_TO_DEG
- See Also:
- Constant Field Values
-
LN_2
public static final float LN_2
-
LN_10
public static final float LN_10
-
INV_LN_2
public static final float INV_LN_2
-
INV_LN_10
public static final float INV_LN_10
-
-
Method Detail
-
InvSqrt
public static float InvSqrt(float fValue)
Calculation of 1/sqrt(fValue)- Parameters:
fValue
- value to calculate 1/sqrt(fValue)- Returns:
- 1/sqrt(fValue)
-
InvSqrt
public static double InvSqrt(double fValue)
Calculation of 1/sqrt(fValue)- Parameters:
fValue
- value to calculate 1/sqrt(fValue)- Returns:
- 1/sqrt(fValue)
-
Log2
public static float Log2(float fValue)
-
SymmetricRandom
public static float SymmetricRandom()
Generate a random number in [-1,1). The random number generator may be seeded by a first call to SymmetricRandom with a positive seed.- Returns:
- a random number in [-1,1)
-
UnitRandom
public static float UnitRandom()
-
-