[Math] compute minimum distance between point and great arc on sphere

spherical-geometry

Suppose I have a point $P$ on a unit sphere whose spherical coordinates are $(\theta, \varphi)$, and a great arc from point $Q$ to point $R$, also specified in spherical coordinates. I want to find the minimum distance (great arc distance, preferably) between the point and the arc. Can somebody help me on that?

My best guess would be to take the formula for the Great arc distance between two points on a unit sphere, plug in a point $S$ parameterized by $t$ on the arc between $Q$ and $R$, and find the minimum distance between $P$ and $S$. But I would definitely need help with that.

Best Answer

Consider the full great circle that your $Q$ to $R$ arc is part of. There are two points (poles) which are each 90 degrees of arc from every point on the great circle. (You can find these points by forming a 90-90-x triangle from your arc segment.) Choosing the point which is on the same hemisphere as your point $P$, there is an arc from this pole, through $P$, to the great circle. Since the length of this arc is 90 degrees, the distance from $P$ to the great circle is the complement of the distance from the pole to $P$.

Determining the distance from $P$ to the actual arc then is just a matter of determining if the intersection point is between $Q$ and $R$, and if not, determining the distances from $P$ to $Q$ and $R$ to get the minimum.

A note to anyone who objects to my use of degrees: sorry, but I use my spherical trig on the actual earth, where lat and long are still measured in degrees. And yes, I am aware it is not a true sphere, but that is a separate topic.