Convert polar coordinates to specific angle range

191 Views Asked by At

I shamefully admit that my trig-skill have rusted.

I have a point on the uniform circle by $\sin(\alpha) = x$ and $\cos(\alpha) = y$ coordinate.

For example: $\alpha = 0 \to (0,1)^T$

The angle is in range $[-\pi,\pi]$

Clockwise is the positive direction eg: $\alpha = \pi/2 \to (1,0)^T$.

Given an $(x,y)$ ordered pair, how do I get the angle ?

2

There are 2 best solutions below

0
On BEST ANSWER

The usual convention is $$\begin{cases}x=\cos\theta,\\ y=\sin\theta\end{cases}$$ so we can make the connection with $$\alpha=\dfrac\pi2-\theta.$$

Then

$$\frac yx=\tan\theta=\cot\alpha$$

and

$$\theta=\arctan\frac yx,\alpha=\arctan\frac xy.$$

Anyway, to retrieve an angle on the four quadrants, you need to consider the signs. If $y<0$, add $\pi$.

1
On

Use the inverse tangent function. Take both lengths and divide x by y.

So,$\frac{sin{(x)}}{cos{(x)}}^{-1}$

$tan^{-1}(n)=\angle{a}$, where “n” is the result of $\frac{sin(x)}{cos(x)}$