You are given three coordinates and radius of sphere: $$ \begin{split} x_1,y_1,z_1 &= \text{ start point};\\ x_2,y_2,z_2 &= \text{ finish point};\\ x_3,y_3,z_3 &= \text{ sphere center};\\ r &= \text{ sphere radius}; \end{split} $$ Find shortest distance between start and finish without crossing sphere. Start and end are not necessary on sphere.

On my observations we need to find two tangent lines which go through start(finish) and arc between tangent line-sphere touching point.

  • $\begingroup$ @Blue I don't think this is a duplicate; in the linked question, it is assumed that the points are on the surface of the sphere, which is not assumed here. $\endgroup$ – Milo Brandt Jan 24 at 18:59
  • $\begingroup$ @MiloBrandt: Perhaps you're right; it's a little hard to tell, but I guess the question deserves the benefit of the doubt. $\endgroup$ – Blue Jan 24 at 19:02
  • $\begingroup$ @Blue: But those points of intersection will never be on the shortest path. $\endgroup$ – TonyK Jan 24 at 20:23

The shortest path is included in the plane defined by the two points and the sphere center (or any plane through these points in case they are aligned).

Now you have to find the shortes path between two points that avoids a circle.

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.