com.metsci.glimpse.util.math.fast
Class PolynomialApprox

java.lang.Object
  extended by com.metsci.glimpse.util.math.fast.PolynomialApprox

public class PolynomialApprox
extends java.lang.Object

This class contains polynomial approximations to Trigonometric functions, which are much faster than the Java built-in routines, but not as accurate.

Author:
ellis

Constructor Summary
PolynomialApprox()
           
 
Method Summary
static double acos_4(double x)
          Fast acos using 4 term polynomial approximation from Abramowitz and Stegun, pg.
static double acos(double x)
          Fast acos using 8 term polynomial approximation from Abramowitz and Stegun, pg.
static double asin_4(double x)
          Fast asin using 4 term polynomial approximation from Abramowitz and Stegun, pg.
static double asin(double x)
          Fast asin using 8 term polynomial approximation from Abramowitz and Stegun, pg.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolynomialApprox

public PolynomialApprox()
Method Detail

acos_4

public static double acos_4(double x)
Fast acos using 4 term polynomial approximation from Abramowitz and Stegun, pg. 81.

Note: Accuracy to within 7 x 10^-5 radians.

Parameters:
x -
Returns:
arccos(x)

acos

public static double acos(double x)
Fast acos using 8 term polynomial approximation from Abramowitz and Stegun, pg. 81.

Note: Accuracy to within 3 x 10^-8 radians.

Parameters:
x -
Returns:
arccos(x)

asin_4

public static double asin_4(double x)
Fast asin using 4 term polynomial approximation from Abramowitz and Stegun, pg. 81.

Note: Accuracy to within 7 x 10^-5 radians.

Parameters:
x -
Returns:
arcsin(x)

asin

public static double asin(double x)
Fast asin using 8 term polynomial approximation from Abramowitz and Stegun, pg. 81.

Note: Accuracy to within 3 x 10^-8 radians.

Parameters:
x -
Returns:
arcsin(x)


Copyright © 2012 Metron, Inc.. All Rights Reserved.