# How to find a point equidistant between two points on a sphere.

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.

• What do you mean by Spherical Geometry? Spherical Coordinates? – Shine On You Crazy Diamond Apr 16 '16 at 22:59
• In general, there will be two points on the equator that are equidistant... – copper.hat Apr 16 '16 at 23:11
• Yes, there would be 2, but I'm looking for the one that is nearest to the G and H. – Dante Apr 18 '16 at 2:00
• Also we're assuming that the earth is a perfect sphere, with a radius of some arbitrary value. It shouldn't be relevant to the problem. – Dante Apr 18 '16 at 2:01
• While I've voted to reopen on the basis of recent edits, it seems curious that you seem on the one hand comfortable abstracting your actual astronomical problem to a setting involving a "spherical earth" with longitude and latitude, but on the other hand uncomfortable with converting between Cartesian coordinates and longitude/latitude. The spherical geometry presents some interesting parallels and contrasts with plane geometry, which I suspect you have already spotted. – hardmath Apr 18 '16 at 2:39

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!

• when you say "cosθsinacosb+sinθsinasinb=cosθsina′cosb′+sinθsina′sinb′cos⁡θsin⁡acos⁡b+sin⁡θsin⁡asin⁡b=cos⁡θsin⁡a′cos⁡b′+sin⁡θsin⁡a′sin⁡b′" do you mean that a is the longitude of one and b is its latitude, while a' and b' are the other's coordinates, respectively? Will I need to convert to cartesian to do this particular method? What is the purpose of the arctan (theta) at the end? Is it necessary? – Dante Apr 18 '16 at 14:48