Calculate the polar angle of a position vector
\(\boldsymbol{a}\in\mathbb{R}^3\), which is the angle of the
x-axis towards the reflected position vector on the x-y-plane
\[\begin{split}\text{polar}(\boldsymbol{a})=\arctan2(x,y)\left\{
\begin{array}{ll}
\tan^{-1}\left(\frac{y}{x}\right)&x>0\\
\tan^{-1}\left(\frac{y}{x}\right)+\pi&x<0,y>0\\
\pm\pi&x<0,y=0\\
\tan^{-1}\left(\frac{y}{x}\right)-\pi&x<0,y<0\\
+\frac{\pi}{2}&x=0,y>0\\
-\frac{\pi}{2}&x=0,y<0
\end{array}
\right.\end{split}\]
with \(x\) as the first vector entry and \(y\) as the second.
Parameters: |
- pos : list
Position vector \(\boldsymbol{a}\)
- is_deg : bool, optional
True if the output should be in degree
|
Returns: |
- angle : float
Polar angle
|