|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gwoptics.mathutils.TrigLookup
public final class TrigLookup
This class provides access to a much faster version of the cos and sin functions. It generates a table of sin values from 0 to 90 to an accuracy of 0.01 degrees. As the first 90 degrees is just mirrored in the 3 other sections. 90 to 180 is 0 to 90 reversed and 180 to 360 is 0 to 180 inverted. Having a small table is important for performance. If the table is too large it will unlikely be stored in the faster CPU cache and instead in RAM. Although this is still relatively fast. Cosine values are generated by the addition of 90 degrees to sin values. This class should be used when accuracy in cos and sin is not imperative.
Constructor Summary | |
---|---|
TrigLookup()
|
Method Summary | |
---|---|
static double |
cos(float value)
Computes a fast cosine of an angle |
static double |
sin(float a)
Computes a fast sin of an angle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TrigLookup()
Method Detail |
---|
public static double cos(float value)
value
-
public static double sin(float a)
value
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |