How can I find the angle between a vector and unit vector [1, 0], but I don't want the shortest angle, but always the right side angle like this:
[1, 0] -> 0
[0, 1] -> PI/2
[-1, 0] -> PI
[0, -1] -> 3 * PI / 2
I've tried arctan(y/x) but what if x is 0 what happens then?
Roughly, you need to compute $\arctan(y/x)$. To be more precise, you also need to work out which quadrant the angle is in. Many programming languages have a function $\texttt{arctan2}(x,y)$ that does all this for you.