Shortest Path That Touches the Circumference Between 2 Points on Disk

Given a starting and ending position in the unit disk, what is the shortest path between the two points that also touches the unit circle? The starting point is labeled s and drawn in green. The ending point is labeled e and drawn in red, and the relative angle between them is β. The angle from the x-axis to s is ϕ. The shortest path touches the unit circle is at angle .
The shortest path between two points that also touches the circumference is composed up of two straight line segments. The problem can be simplified by choosing the coordinate system carefully. We define the x-axis along the position of the starting point: S = (s,0), and define the point of intersection by the angle θ from the x-axis P = (cos(θ), sin(θ)), and the final point by a radius e and angle β, E = e(Cos(β), sin(β)). Then define a symmetry point about S of line OP named T. Then the length of the two line segments is , which is minimized by choosing an appropriate θ value. This equation can be simplified to . The length of the two line segments as a function of θ is drawn in the right plot.
There are several simple solutions. If s is 1 or e is 0 or β is zero, the optimal angle is 0. If e is 1 or s is 0, the optimal angle is β.
We label the origin O. The optimal solution shows that the angle ∠OPS (from the origin to P to S) is the same as the angle ∠OPE (from the origin to P to E).
We name these angles α. This can be proved by drawing an ellipse whose foci are S and E. When the ellipse is tangent to the circle, the point of tangency is exactly P.
Since the distance from the origin to P is always 1, we can set up three equalities using the law of sines:
From triangle OSP: .
From triangle OEP: .
If we mirror the point S about the θ axis, and label this point C, from triangle CEO:
Simplifying this system of equations results in:
s=e csc(θ)(s sin(2 θ-β)+sin(β-θ)).
Solving this last equation results in a quartic solution. It has a closed form solution with four roots, each of which can be either a clockwise or a counterclockwise rotation θ, depending on the sign of β, with -π ≤ β ≤ π. We evaluate each and select the solution that results in the shortest length path.
  • Contributed by: Jingang Shi and Aaron T. Becker
  • University of Houston



  • [Snapshot]
  • [Snapshot]
  • [Snapshot]
Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2018 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+