So I have this problem involving astronomy, but because astronomy uses all sorts of fancy words I'm going to make it more simple by using an analogy of the earth. The process, mathematically would be exactly the same.
There are two cities on the earth with the lat/long coordinates (40W,20S) (which we'll call G) and (50E,6N) (Which we'll call H). What point on the equator is equidistant from both G and H?
However: I don't want the straight distance from G or H to this mystery point on the equator. I want to take into account the spherical shape of the earth, so it would require some spherical geometry.
I need the answer in latitude/longitude, not cartesian coordinates. Because I plan on doing several of these, please explain how you calculated this.
The a specification of the equator in spherical coordinates is
$$\phi = \pi/2, \\ r=R, \\ \theta \in [0, 2\pi] $$
Let's forget about the $r$ coordinate because we'll be solely working on the surface of the sphere, $r = R$.
First convert your coordinates that are in degrees to radians for discussion. Let $\theta = $ a general point on the equator.
The spherical surface distance between $(\phi, \theta)$ and $(a,b)$ can be found by converting to Cartesian coordinates, taking the dot product to get the $\cos ($ the angle between the two vectors $)$, calculating the length of an arc with that angle.
Now you can come up with the formula for Spherical-to-Cartesian coordinates by drawing the system out on paper, or just refer here:
Wikipedia: Spherical Coordinates
$x = R \sin \phi \cos \theta \\ y = R \sin \phi \sin \theta \\ z = R \cos \phi $ similarly $x' = R\sin a \cos b \\ y' = R\sin a \sin b \\ z' = R \cos a $ Now normalize by dividing out the $R$, and take the dot product: $\hat{v} \cdot \hat{v}' = \cos \psi = \sin \phi \cos \theta \sin a \cos b + \sin \phi \sin \theta \sin a \sin b + \cos \phi \cos a =$ (since $\phi = \pi/2$ always in your problem): $\cos \theta \sin a\cos b + \sin \theta \sin a\sin b + 0$
Since the length of an entire circumference over a circle is $2\pi R$, to get the arclength you simply multiply $R$ by the fraction $\psi/(2\pi)$.
So you have two $\psi$'s in your problem, one for each point. You want to know when the value of $\theta$ when $\psi = \psi'$ or
$\cos\theta \sin a \cos b + \sin\theta \sin a\sin b = \cos\theta \sin a' \cos b' + \sin \theta \sin a' \sin b'$ or $\cos \theta (A - B) + \sin \theta (C - D) = 0$, since you already know $A, B, C, D$ - they're given by your points.
I think you can solve that some more by getting $\sin \theta / \cos \theta = \tan \theta$ and taking the $\text{arctan2}$.
Hope that helps!