public class ApproxSin extends Object
com.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.
Modifier and Type | Field and Description |
---|---|
static double |
ONE_OVER_TWO_PI |
Constructor and Description |
---|
ApproxSin(int numSamples) |
Modifier and Type | Method and Description |
---|---|
static double |
normalizeAngleTwoPi(double x_RAD) |
double |
sin(double x_RAD) |
public static final double ONE_OVER_TWO_PI
Copyright © 2018 Metron, Inc.. All rights reserved.