The shortest path between point B on a sphere and point A away from the sphere without traveling through the sphere

3dgeometryspheres

I have a point A outside of a sphere (radius r, center point S) and a point B on the surface of that sphere. How long is the shortest path from A to B, that does not travel through the inside of the sphere?

I know that path would travel through space tangentially to the sphere, hit the sphere at some point C, and then follow a great arc along the surface of the sphere (unless point B can "see" point A, at which point the problem becomes trivial). But I just cannot figure out how to find point C.

I can semi-solve the problem in 2D: The distance $\overline{AC}$ can be calculated as $\sqrt{\overline{AS}^2-r^2}$ when applying the Pythagorean theorem in triangle ASC. The angle $\phi_{CSB}$ between $\overline{CS}$ and $\overline{SB}$ is $\phi_{CSB}=\phi_{ASB}-\phi_{ASC}$, where the angle $\phi_{ASB}$ between $\overline{AS}$ and $\overline{SB}$ can be calculated from A and B, and the angle $\phi_{ASC}=\arccos{\frac{r}{\overline{AS}}}$ between $\overline{AS}$ and $\overline{SC}$ can be derived from the properties of the constructed triangle ASC. This yields the distance $\overline{CB}'=r\phi_{CSB}$ between points C and B along the circle.
Even here, I still miss the minimization step (since there are two possible points C).

The final application for this is in programming, and it would absolutely be possible to sample the circle of possible points C and solve (parts of) the problem numerically, but it would also be equally unsatisfying 🙂

Best Answer

I honestly believe you need to go as far as possible using a straight line (which you can achieve using a tangent line), and continue on the circle from there.

In a drawing:

enter image description here

I believe the smallest distance from $C$ to $B$ is by going from $C$ to $E$ (over the tangent line), and continue of the circle up to $B$.

In order to understand why this is the smallest distance, just imagine a point $X$ somewhere on the circle between $D$ and $E$. The total distance to cross is then $|CX|$ + $\text{arclength(XB)}$, where $\text{arclength(XB)}$ is the length of the arc over the circle, going from $X$ to $B$.
It is obvious that $\text{arclength(XB)} = \text{arclength(XE)} + \text{arclength(EB)}$, meaning that you need to minimise $|CX| + \text{arclength(XE)}$. As the smallest distance between two points is a straight line, you can easily see that that minimal distance is reached when $X=E$.

Related Question