The MathSenCosLookupTable.as script makes a look up table for sen and cos values. This design pattern uses more memory in order to use less processing.
How to use MathSenCosLookupTable.as
To use this script just create an instance where you want to use it and call sen or cos functions. This functions will automatically return you the values using a LookUp Table.
Here are the two possible examples:
trace(lookUpTable.getSen(5)); trace(lookUpTable.getCos(5));
In the first case we trace the sen of 5, in the second one we trace the cos of 5. Make sure to always refer to the same LookUp table.
Public Functions
- getSen(n:int):Number
- getCos(n:int):Number
Private Vars
- _senD:Dictionary
- _cosD:Dictionary;