toxi.math
Class SinCosLUT
java.lang.Object
toxi.math.SinCosLUT
public final class SinCosLUT
- extends java.lang.Object
Lookup table for fast sine & cosine computations. Tables with varying
precisions can be created to which input angles will be rounded to. The
sin/cos methods can be used with both positive and negative input angles as
with the normal Math.sin()/Math.cos() versions.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_PRECISION
public static final float DEFAULT_PRECISION
- default precision
- See Also:
- Constant Field Values
SinCosLUT
public SinCosLUT()
SinCosLUT
public SinCosLUT(float precision)
getDefaultInstance
public static final SinCosLUT getDefaultInstance()
cos
public final float cos(float theta)
- Calculate cosine for the passed in angle in radians.
- Parameters:
theta
-
- Returns:
- cosine value for theta
getPeriod
public int getPeriod()
getPrecision
public float getPrecision()
getSinLUT
public float[] getSinLUT()
sin
public final float sin(float theta)
- Calculates sine for the passed angle in radians.
- Parameters:
theta
-
- Returns:
- sine value for theta