com.metsci.glimpse.util.math.fast

## Class PolynomialApprox

• ```public class PolynomialApprox
extends 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

Constructors
Constructor and Description
`PolynomialApprox()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`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.
`static double` `atan(double x)`
`static double` ```atan2(double y, double x)```
• ### 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)
• #### atan

`public static double atan(double x)`
• #### atan2

```public static double atan2(double y,
double x)```