Packagesandy.math
Classpublic class FastMath

Fast trigonometry functions using cache table and precalculated data. Based on Michael Kraus implementation.



Public Methods
 MethodDefined by
  
cos(radians:Number):Number
[static] Returns the cosine of a given value, by looking up it's approximation in a precomputed table.
FastMath
  
sin(radians:Number):Number
[static] Returns the sine of a given value, by looking up it's approximation in a precomputed table.
FastMath
  
tan(radians:Number):Number
[static] Returns the tangent of a given value, by looking up it's approximation in a precomputed table.
FastMath
Public Constants
 ConstantDefined by
  HALF_PI : Number
[static]
FastMath
  initialized : Boolean
[static]
FastMath
  PRECISION : int = 0x020000
[static] Precission.
FastMath
  PRECISION_DIV_2PI : Number
[static]
FastMath
  PRECISION_S : int = 131071.0
[static]
FastMath
  TWO_PI : Number
[static]
FastMath
Method detail
cos()method
public static function cos(radians:Number):Number

Returns the cosine of a given value, by looking up it's approximation in a precomputed table.

Parameters
radians:Number — The value to cosine.

Returns
Number — The approximation of the value's cosine.
sin()method 
public static function sin(radians:Number):Number

Returns the sine of a given value, by looking up it's approximation in a precomputed table.

Parameters
radians:Number — The value to sine.

Returns
Number — The approximation of the value's sine.
tan()method 
public static function tan(radians:Number):Number

Returns the tangent of a given value, by looking up it's approximation in a precomputed table.

Parameters
radians:Number — The value to tan.

Returns
Number — The approximation of the value's tangent.
Constant detail
HALF_PIconstant
public static const HALF_PI:Number
initializedconstant 
public static const initialized:Boolean
PRECISIONconstant 
public static const PRECISION:int = 0x020000

Precission. The bigger, the more entries in lookup table so the more accurate results.

PRECISION_DIV_2PIconstant 
public static const PRECISION_DIV_2PI:Number
PRECISION_Sconstant 
public static const PRECISION_S:int = 131071.0
TWO_PIconstant 
public static const TWO_PI:Number