Class ApproxSin
- java.lang.Object
-
- com.metsci.glimpse.util.math.approx.ApproxSin
-
public class ApproxSin extends Object
Similar to the classes incom.metsci.glimpse.util.math.fast, but uses linear interpolation between samples instead of nearest-neighbor.Anecdotally, speed is about 12x faster than
Math.sin(double). With 100k samples, max error is around 5e-10. Max error decreases as the number of samples increases.
-
-
Field Summary
Fields Modifier and Type Field Description static doubleONE_OVER_TWO_PI
-
Constructor Summary
Constructors Constructor Description ApproxSin(int numSamples)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static doublenormalizeAngleTwoPi(double x_RAD)doublesin(double x_RAD)
-
-
-
Field Detail
-
ONE_OVER_TWO_PI
public static final double ONE_OVER_TWO_PI
- See Also:
- Constant Field Values
-
-