Formal Definition for Angle Function

339 Views Asked by At

Which is the correct formal definition for the angle function $\theta(x,y)$ for a vector $(x,y)$ or complex number $x+iy$ with unit magnitude, such as $e^{i \theta}=x+iy$?

Inverse trigonometric functions do not map into the full circle.

In Matlab,

$\theta=\text{atan2}(x,y):x \in [-1,1], y \in [-1,1] \to \theta \in [-\pi,\pi]$

But i dont think this is a formal standard.

2

There are 2 best solutions below

0
On BEST ANSWER

I checked this article regarding the Argument Function, citing the last formula for the double angle tangent, as the most formal and numerically stable definition for the argument function, and hence, for the $\text{atan2}$ function i have been able to find so far:

$$ \text{atan2}(x,y)= \left\{\begin{array}{cc} 2\arctan\left(\frac{\sqrt{x^2+y^2}-x}y \right) & y\ne0\\ 0 & y=0, x>0\\ \pi & y=0, x<0\\ \text{undef.} & y=0, x=0 \end{array} \right. $$

0
On

It is a basic fact of analysis that there is no continuous real-valued "angle function" $\ \theta:\>\dot{\mathbb R}^2\to{\mathbb R}$. Instead we have the argument function $${\rm arg}:\quad\dot{\mathbb R}^2\to{\mathbb R}/(2\pi{\mathbb Z})$$ that for each point $(x,y)\in\dot{\mathbb R}^2$ gives its polar angle modulo (or "up to multiples of") $2\pi$. Even though this is not a real-valued function it has a well defined gradient $$\nabla{\rm arg}(x,y)=\left({-y\over x^2+y^2},\>{x\over x^2+y^2}\right)\qquad\bigl((x,y)\in\dot{\mathbb R}^2\bigr)\ .$$ For many purposes it is sufficient to consider the principal value of the argument. It is defined by $${\rm Arg}(x,y):={\rm the}\bigl\{{\rm arg}(x,y)\>\cap\>]{-\pi},\pi[\>\bigr\}$$ on $\dot{\mathbb R}^2$ with the negative $x$-axis removed. Note that people often write ${\rm arg}$ when actually ${\rm Arg}$ is meant. The connection with the inverse trigonometric function is as follows: When $x>0$ (and only then!) one has $${\rm Arg}(x,y)=\arctan{y\over x}\qquad(x>0)\ .$$