Enum Class FastMath

java.lang.Object
java.lang.Enum<FastMath>
com.ardor3d.math.FastMath
All Implemented Interfaces:
Serializable, Comparable<FastMath>, Constable

public enum FastMath extends Enum<FastMath>
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
NB: With current improvements in hardware, I don't recommend using these and they will likely be deprecated/removed in the future.
  • Field Details

  • Method Details

    • values

      public static FastMath[] 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

      public static FastMath valueOf(String name)
      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 name
      NullPointerException - 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)