Minimum distance between two moving points on a sphere

276 Views Asked by At

I'm working on a vessel collision detection module for Python. With the latitude, longitude, bearing, and speed at a specific time of two vessels, how might I calculate the minimum distance between the two vessels? And the time when this would occur?

A similar question Shortest distance between two moving points was answered in 2D.

1

There are 1 best solutions below

3
On BEST ANSWER

You can do this as follows:

  1. Consider the sphere of radius $1$ centered at $(0,0,0)$ in $\mathbb{R}^3$. You can always reduce to this case.
  2. Write down the trajectories $\gamma_1(t)$ and $\gamma_2(t)$ as functions $$\mathbb{R}\longrightarrow\mathbb{R}^3.$$
  3. If $\gamma_1(t) = \gamma_2(t)$ for some $t$, then you are done. Else find the extrema of $$F(t) = \|\gamma_1(t)-\gamma_2(t)\|^2,$$ select the minima among them and then take the one with the smallest value for $F$.