Finding angle between a point and the positive horizontal axis relative to another point? Say I have coordinates center X, center Y. I also have myX and myY.
I'm writing a 2D game, and I need the second point to revolve around the first.
This involves finding the angle between the revolver and the "positive-x-axis" from the center point.
How can I do this?
 A: An alternative approach would be to just rotate the 'my' point about the current point by some angle $\theta$ without computing the current angle. This avoids any 'fiddlyness' with $\arctan$. I am using the usual (in mathematics, not screens) axes here.
Let $c=\cos \theta$, $s=\sin \theta$. Let $(x,y)$ be the current point, and let $(x',y')$ be the 'my' point. Then to compute the rotated 'my' point, compute
$$\binom{x_{my\_rotated}}{y_{my\_rotated}} = \binom{x}{y} + \begin{bmatrix} c & -s \\ s & c \end{bmatrix} \binom{x'-x}{y'-y}.$$
Or explicitly: $x_{my\_rotated} = x+c(x'-x)-s(y'-y)$, $y_{my\_rotated} = y+s(x'-x)+c(y'-y)$.
A: Following Whocares notation, if the center is $A=(A_x,A_y)$ and the rotating point is $B=(B_x,B_y)$, you can use the atan2 function and ask for atan2$(B_x-A_x,B_y-A_y)$.  It normally returns the angle in the range $(-\pi, \pi]$ and is in radians (check the documentation of your language), but it worries about all four quadrants for you.  If you want to consider that the $y$ axis is going downward, you may have to reverse the sign
A: I'll call the center point $A$ and the rotating point $B$.
So $A=(A_x,A_y)$ and $B=(B_x,B_y)$
The equation you are looking for is $angle=\arctan((B_y-A_y)/(B_x-A_x))$
