A number.
The context settings to use.
Calculates the inverse trigonometric sine of a number with rounding according to the given context.
Method:
If \( x < 0.5 \) use the definition from integration:
\[ \sin^{-1} x = \int_0^x \frac{dt}{\sqrt{1-t^2}} \]
Since \( x < 1 \)
\[ \sin^{-1} = \sum_{n=0}^\infty \frac{(2n-1)!!}{2^n n!} \cdot \frac{x^{2n+1}}{2n+1} \]
If \( x \geqslant 0.5 \)
\[ \sin^{-1} x = \frac{\pi}{2} - \sin^{-1} \sqrt{\frac{1-x}{2}} \]
A number.
The context settings to use.
Calculates the inverse trigonometric tangent of a number with rounding according to the given context.
Method:
The input can be divided into 4 regions for fast convergence.
\[ \tan^{-1} = \sum_{n=0}^{\infty} (-1)^n \frac{x^{2n+1}}{2n+1} \]
\[ \tan^{-1} x = \frac{\pi}{4} - \tan^{-1} \left( \frac{1-x}{1+x} \right) \]
\[ \tan^{-1} x = \frac{\pi}{4} + \tan^{-1} \left( \frac{x-1}{x+1} \right) \]
\[ \tan^{-1} x = \frac{\pi}{4} + \tan^{-1} \left( \frac{1}{x} \right) \]
A number.
The context settings to use.
Calculates the solution for \( \theta \) for the set of equations
\[ \begin{align} x &= r \cos \theta \\ y &= r \sin \theta \end{align} \]
Put simply, the above boils down to \[ \operatorname{atan2}(y, x) = \begin{cases} \arctan(\frac{y}{x}) &\text{if } x > 0, \\ \arctan(\frac{y}{x}) + \pi &\text{if } x < 0 \text{ and } y \geqslant 0, \\ \arctan(\frac{y}{x}) - \pi &\text{if } x < 0 \text{ and } y < 0, \\ +\frac{\pi}{2} &\text{if } x = 0 \text{ and } y > 0, \\ -\frac{\pi}{2} &\text{if } x = 0 \text{ and } y < 0, \\ \text{undefined} &\text{if } x = 0 \text{ and } y = 0 \end{cases} \]
The vertical component.
The horizontal component.
The context settings to use.
Calculates the trigonometric cosine with rounding according to the given context.
Method:
For \( x < 2\pi \) The Taylor series converges for all \( x \).
\[ \cos x = \sum_{n=0}^{\infty} (-1)^n \frac{x^{2n}}{(2n)!} \]
For \( x \geqslant 2\pi \), range reduction can be performed. The \( \cos x \) function has a periodicity of \( 2\pi \).
\[ x \equiv f \pmod{2\pi} \]
A number.
The context settings to use.
Calculates the trigonometric sine with rounding according to the given context.
Method:
For \( x < 2\pi \) The Taylor series converges for all \( x \).
\[ \sin x = \sum_{n=0}^{\infty} (-1)^n \frac{x^{2n+1}}{(2n+1)!} \]
For \( x \geqslant 2\pi \), range reduction can be performed. The \( \sin x \) function has a periodicity of \( 2\pi \).
\[ x \equiv f \pmod{2\pi} \]
A number.
The context settings to use.
Calculates the trigonometric tangent with rounding according to the given context.
Method:
\[ \tan x = \frac{\sin x}{\cos x} \]
A number.
The context settings to use.
Generated using TypeDoc
Calculates the inverse trigonometric cosine of a number with rounding according to the given context.
Method:
If \( \lvert x \rvert < 0.5 \), \[ \cos^{-1} x = \frac{\pi}{2} - \sin^{-1} x \]
otherwise, \[ \cos^{-1} x = 2 \sin^{-1} \sqrt{\frac{1-x}{2}} \]
asin