Package com.ardor3d.math
Enum Class FastMath
- All Implemented Interfaces:
Serializable
,Comparable<FastMath>
,Constable
A "close approximation" class for Math operations.
References:
- http://www.devmaster.net/forums/showthread.php?t=5784
- http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf
- http://stackoverflow.com/questions/523531/fast-transcendent-trigonometric-functions-for-java
- http://www.lightsoft.co.uk/PD/stu/stuchat37.html
- http://wiki.java.net/bin/view/Games/JeffGems
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
static final double
static final double
static final double
static final double
static final double
static final double
-
Method Summary
Modifier and TypeMethodDescriptionstatic final double
acos
(double x) acos: [-1,1] → [0,π]static final double
asin
(double x) asin: [-1,1] → [-π/2,π/2]static final double
atan
(double x) atan: (-‚àû,‚àû) → (-π/2,π/2)static final double
cos
(double x) cos: [-π,π] → [-1,1]static final double
inverseSqrt
(double x) inverseSqrt: (0,‚àû) → (0,‚àû)static final double
sin
(double x) sin: [-π,π] → [-1,1]static final double
sqrt
(double x) static final double
tan
(double x) tan: [-π,π] \ {-π/2,π/2} → Rstatic FastMath
Returns the enum constant of this class with the specified name.static FastMath[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Field Details
-
EPSILON_SIN
public static final double EPSILON_SIN- See Also:
-
EPSILON_COS
public static final double EPSILON_COS- See Also:
-
EPSILON_SIN2COS2
public static final double EPSILON_SIN2COS2- See Also:
-
EPSILON_ASIN
public static final double EPSILON_ASIN- See Also:
-
EPSILON_ACOS
public static final double EPSILON_ACOS- See Also:
-
EPSILON_ATAN
public static final double EPSILON_ATAN- See Also:
-
EPSILON_SQRT
public static final double EPSILON_SQRT- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
sin
public static final double sin(double x) sin: [-π,π] → [-1,1]- Parameters:
x
- x- Returns:
- the sine
-
cos
public static final double cos(double x) cos: [-π,π] → [-1,1]- Parameters:
x
- x- Returns:
- the cosine
-
tan
public static final double tan(double x) tan: [-π,π] \ {-π/2,π/2} → R- Parameters:
x
- x- Returns:
- the tangent
-
asin
public static final double asin(double x) asin: [-1,1] → [-π/2,π/2]- Parameters:
x
- x- Returns:
- the arc sine
-
acos
public static final double acos(double x) acos: [-1,1] → [0,π]- Parameters:
x
- x- Returns:
- the arc cosine
-
atan
public static final double atan(double x) atan: (-‚àû,‚àû) → (-π/2,π/2)- Parameters:
x
- x- Returns:
- the arc tangent
-
inverseSqrt
public static final double inverseSqrt(double x) inverseSqrt: (0,‚àû) → (0,‚àû)- Parameters:
x
- x- Returns:
- the inverse square root
-
sqrt
public static final double sqrt(double x)
-