Calculating Angle Between Two Circles With Same Center Point - Mercury Retrogrades I want to calculate the angle between points on two circles with the same center point. Each point is a planet in its orbit. I have the degrees of each point in the circle. What I want to know is how to calculate the angle between the two. I'm using this to calculate the retrogrades of Mercury, and have been working on this project for about three weeks. Maybe you know a better way to do it?
Mercury: 329
Earth  : 77

Where the value for Mercury and Earth are in degrees.
I'm learning the math as I go, so if you could explain things that would be great!
I have the ratio of Mercury's orbit to Earth. This changes based on the date.
Mercury: 0.431094585293355

Earth: 0.985210404350114

Try to calculate the angle between the gray dot and the blue dot, from the perspective of the black dot. Angle ME When the numbers are given in degrees.

 A: Take a look at this figure featuring the idealized (!) circular and concentric orbits of the Earth (E) and Mercury (M).

Let us apply to triangle $ESM_1$ the "sine rule" stating that  the sines of angles are in the same ratio as the lengths of opposite sides, giving, with Astronomical Units:
$$\frac{\sin a}{SM_1}=\frac{\sin (\pi-(a+b))}{SE} \ \iff \ \frac{\sin a}{0.387}=\frac{\sin (a+b)}{1} \tag{1}$$
(we have used the fact that the sum of angles in a triangle is $\pi$ radians)
$b$ can be extracted from (1) in the following way:
$$b=\sin^{-1}\left(\tfrac{1}{0.387} \sin a\right)-a \ \ \ \ \ \text{(a and b in radians)}\tag{2}$$
which become, for angles defined in degrees:
$$b=\tfrac{180}{\pi}\sin^{-1}\left(\tfrac{1}{0.387} \sin a \tfrac{\pi}{180}\right)-a \tfrac{\pi}{180}\tag{2'}$$
Is it this kind of formula you are looking for ($a$ being the angle observed on your instrument), from which you deduce the relative angle $b$ ?
Formula (2) is valid for point $M_1$ ; it must be adapted to compute the angle associated with the other possible position $M_2$ for the same observation angle $a$. Do you see how ?
A: For those of you who try taking on projects like this, I recommend two books by Montenbruck. Practical Ephemeris Calculations, and Astronomy on the Personal Computer. There have been people make programs that do all this, save yourself the hassle, and use what others have made. It is out there.
I found a solution in what someone else made.
