com.jme.math
Class FastMath.FastTrig

java.lang.Object
  extended bycom.jme.math.FastMath.FastTrig
Enclosing class:
FastMath

public static class FastMath.FastTrig
extends java.lang.Object

FastTrig is used to calculate quick trig functions using a lookup table.

Author:
Erikd, Jack Lindamood (javadoc only)

Field Summary
static int PRECISION
          The size of the lookup table.
 
Constructor Summary
FastMath.FastTrig()
           
 
Method Summary
static float cos(float radians)
          Returns the cosine of a given value, by looking up it's approximation in a precomputed table.
static float sin(float radians)
          Returns the sine of a given value, by looking up it's approximation in a precomputed table.
static float tan(float radians)
          Returns the tangent of a given value, by looking up it's approximation in a precomputed table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRECISION

public static int PRECISION
The size of the lookup table. The bigger, the more accurate.

Constructor Detail

FastMath.FastTrig

public FastMath.FastTrig()
Method Detail

sin

public static float sin(float radians)
Returns the sine of a given value, by looking up it's approximation in a precomputed table.

Parameters:
radians - The value to sine.
Returns:
The approximation of the value's sine.

cos

public static float cos(float radians)
Returns the cosine of a given value, by looking up it's approximation in a precomputed table.

Parameters:
radians - The value to cosine.
Returns:
The approximation of the value's cosine.

tan

public static float tan(float radians)
Returns the tangent of a given value, by looking up it's approximation in a precomputed table.

Parameters:
radians - The value to tan.
Returns:
The approximation of the value's tangent.