You can use one of the following three formulas to find an angle.
1)$$f(x,y)=\pi-\frac{\pi}{2}(1+\mbox{sgn}(x))(1-\mbox{sgn}(y^2))-\frac{\pi}{4}\left(2+\mbox{sgn}(x)\right)\mbox{sgn}(y)$$
$$-\mbox{sgn}(xy)*\mbox{atan}\left(\frac{|x|-|y|}{|x|+|y|}\right)$$
2)$$f(x,y)=\pi-\frac{\pi}{2}(1+\mbox{sgn}(x))(1-\mbox{sgn}(y^2))-\frac{\pi}{4}(2+\mbox{sgn}(x))\mbox{sgn}(y)$$
$$-\mbox{sgn}(xy)\mbox{asin}\left(\frac{\left|x\right|-\left|y\right|}{\sqrt{2*x^2+2*y^2}}\right)$$
3)$$f(x,y)=\pi-\frac{\pi}{2}(1+\mbox{sgn}(x))(1-\mbox{sgn}(y^2))-\frac{\pi}{4}(2+\mbox{sgn}(x))\mbox{sgn}(y)$$
$$-\mbox{sgn}(\left|x\right|-\left|y\right|)\mbox{sgn}(xy)\mbox{acos}\left(\frac{\left|x\right|+\left|y\right|}{\sqrt{2*x^2+2*y^2}}\right)$$
Each of the formulas give the angle from $0$ to $2\pi$ for any value of $x$ and $y$.
For $x=y=0$, the result is undefined.