## Class TrigMath

• ```@CheckReturnValue
public final class TrigMath
extends Object```
A class designed for fast trigonometry operations. Sine, cosine, tangent, cotangent secant and cosecant use a sine float table.
• ### Field Summary

Fields
Modifier and Type Field Description
`static double` `DEG_TO_RAD`
`static double` `HALF_DEG_TO_RAD`
`static double` `HALF_PI`
`static double` `HALF_SQRT_OF_TWO`
`static double` `PI`
`static double` `QUARTER_PI`
`static double` `RAD_TO_DEG`
`static double` `SQRT_OF_TWO`
`static double` `SQUARED_PI`
`static double` `THREE_PI_HALVES`
`static double` `TWO_PI`
• ### Method Summary

All Methods
Modifier and Type Method Description
`static double` `acos​(double value)`
Calculates the arc cosine of the value specified

Returns NaN if the input value is outside the cosine range
`static double` `acot​(double value)`
Calculates the arc cotangent of the value specified

Returns NaN if the input value is outside the cotangent range
`static double` `acsc​(double value)`
Calculates the arc cosecant of the value specified

Returns NaN if the input value is outside the cosecant range
`static double` `asec​(double value)`
Calculates the arc secant of the value specified

Returns NaN if the input value is outside the secant range
`static double` `asin​(double value)`
Calculates the arc sine of the value specified

Returns NaN if the input value is outside the sine range
`static double` `atan​(double value)`
Calculates the arc tangent of the value specified
`static double` ```atan2​(double y, double x)```
Computes the phase theta by computing an arc tangent of y/x
Gets the yaw rotation component in radians when looking into the direction specified
`static float` `cos​(double angle)`
Cosine calculation using a table.
`static float` `cot​(double angle)`
Cotangent calculations using a table.
cos(angle) / sin(angle)
`static float` `csc​(double angle)`
Cosecant calculations using a table.
1 / sin(angle)
`static float` `sec​(double angle)`
Secant calculations using a table:
1 / cos(angle)
`static float` `sin​(double angle)`
Sine calculation using a table.
`static float` `tan​(double angle)`
Tangent calculations using a table.
sin(angle) / cos(angle)
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Field Detail

• #### SQUARED_PI

`public static final double SQUARED_PI`
Constant Field Values
• #### HALF_PI

`public static final double HALF_PI`
Constant Field Values
• #### QUARTER_PI

`public static final double QUARTER_PI`
Constant Field Values
• #### TWO_PI

`public static final double TWO_PI`
Constant Field Values
• #### THREE_PI_HALVES

`public static final double THREE_PI_HALVES`
Constant Field Values

`public static final double DEG_TO_RAD`
Constant Field Values

`public static final double HALF_DEG_TO_RAD`
Constant Field Values

`public static final double RAD_TO_DEG`
Constant Field Values
• #### SQRT_OF_TWO

`public static final double SQRT_OF_TWO`
• #### HALF_SQRT_OF_TWO

`public static final double HALF_SQRT_OF_TWO`
• ### Method Detail

• #### sin

`public static float sin​(double angle)`
Sine calculation using a table.

No interpolation is performed: Accuracy is up to the 6th decimal place.

Parameters:
`angle` - the angle in radians
Returns:
the sine of the angle
• #### cos

`public static float cos​(double angle)`
Cosine calculation using a table.

No interpolation is performed: Accuracy is up to the 6th decimal place.

Parameters:
`angle` - the angle in radians
Returns:
the cosine of the angle
• #### tan

`public static float tan​(double angle)`
Tangent calculations using a table.
sin(angle) / cos(angle)

No interpolation is performed: Accuracy is up to the 6th decimal place.

Parameters:
`angle` - in radians
Returns:
the tangent of the angle
• #### csc

`public static float csc​(double angle)`
Cosecant calculations using a table.
1 / sin(angle)

No interpolation is performed: Accuracy is up to the 6th decimal place.

Parameters:
`angle` - the angle in radians
Returns:
the cosecant of the angle
• #### sec

`public static float sec​(double angle)`
Secant calculations using a table:
1 / cos(angle)

No interpolation is performed: Accuracy is up to the 6th decimal place.

Parameters:
`angle` - the angle in radians
Returns:
the secant of the angle
• #### cot

`public static float cot​(double angle)`
Cotangent calculations using a table.
cos(angle) / sin(angle)

No interpolation is performed: Accuracy is up to the 6th decimal place.

Parameters:
`angle` - in radians
Returns:
the cotangent of the angle
• #### asin

`public static double asin​(double value)`
Calculates the arc sine of the value specified

Returns NaN if the input value is outside the sine range
Parameters:
`value` - of the sine
Returns:
• #### acos

`public static double acos​(double value)`
Calculates the arc cosine of the value specified

Returns NaN if the input value is outside the cosine range
Parameters:
`value` - of the cosine
Returns:
• #### atan

`public static double atan​(double value)`
Calculates the arc tangent of the value specified
Parameters:
`value` - of the tangent
Returns:
• #### atan2

```public static double atan2​(double y,
double x)```
Computes the phase theta by computing an arc tangent of y/x
Gets the yaw rotation component in radians when looking into the direction specified
Parameters:
`y` - direction
`x` - direction
Returns:
• #### acsc

`public static double acsc​(double value)`
Calculates the arc cosecant of the value specified

Returns NaN if the input value is outside the cosecant range
Parameters:
`value` - of the cosecant
Returns:
• #### asec

`public static double asec​(double value)`
Calculates the arc secant of the value specified

Returns NaN if the input value is outside the secant range
Parameters:
`value` - of the secant
Returns:
`public static double acot​(double value)`
`value` - of the cotangent