This week’s Riddler Classic is a geometry problem about traversing the surface of a cone

The circular base of the cone has a radius of 2 meters and a slant height of 4 meters. We start on the base, a distance of 1 meter away from the center. The goal is to reach the point half-way up the cone, 90 degrees around the cone’s central axis from the start, as shown. What is the shortest path?

Here is my solution:

[Show Solution]

Suppose the base has radius $r_0$ and we start a distance $\rho_0$ from the center (point $A$). Suppose the slant height is $r_1$ and our goal is to reach a point $\rho_1$ from the top (point $B$). We can break the journey into two parts. No matter how we get from $A$ to $B$, we must reach the edge of the base (point $X$) at some point on our journey. Suppose $X$ is located at an angle $\theta$ from the center of the base.

In the diagram above, we show the 3D cone and the corresponding unfolded 2D version to the right. The corresponding points have matching labels (click the diagram to enlarge) The first part of the journey, from $A$ to $X$, should be a straight line, since this is the shortest distance connecting two points on a flat surface. By the law of cosines, the distance $AX$ is

\[

|AX| = \sqrt{ r_0^2 + \rho_0^2-2r_0\rho_0\cos(\theta) }

\]The second part of the journey, from $X$ to $B$, will be a curved path along the surface of the cone. However, since we want the shortest possible path, this will be a straight line if we *unfold* the cone. This unfolded cone is a circular sector with radius $r_1$. Based on the diagram below, we can apply the law of cosines again to find the distance $XB$:

\[

|XB| = \sqrt{ r_1^2 + \rho_1^2-2r_1\rho_1\cos(\phi) }

\]But what is $\phi$? The arclengths along the edge of the base for both parts of the path must sum to 90 degrees. So the sum of both arclengths must equal one quarter of the circumference of the base. In other words, the points $X’$ and $R’$ must coincide with $X$ and $R$, respectively, when we fold the cone back together. Therefore,

\[

r_0 \theta + r_1 \phi = \tfrac{\pi}{2}r_0

\]Putting these three ingredients together, our goal is to solve the optimization problem:

\begin{align}

\underset{\theta,\phi}{\text{minimize}} \quad & \sqrt{ r_0^2 + \rho_0^2-2r_0\rho_0\cos(\theta) } + \sqrt{ r_1^2 + \rho_1^2-2r_1\rho_1\cos(\phi) } \\

\text{subject to} \quad & r_0 \theta + r_1 \phi = \tfrac{\pi}{2}r_0 \\

& 0 \leq \theta \leq \tfrac{\pi}{2}

\end{align}

Eliminating $\phi$ from the objective, we can write a single expression for the total distance $f(\theta)$ traveled in terms of the location $\theta$ of the crossover point:

\[

f(\theta) = \sqrt{ r_0^2 + \rho_0^2-2r_0\rho_0\cos(\theta) }

+ \sqrt{ r_1^2 + \rho_1^2-2r_1\rho_1\cos\Bigl[\tfrac{r_0}{r_1}\bigl(\tfrac{\pi}{2}-\theta\bigr)\Bigr] }

\]Here is a plot of what this function looks like when we use the parameters given in the problem statement ($r_0=2$, $\rho_0=1$, $r_1=4$, $\rho_1=2$)

We can see the minimum occurs at around 30 degrees. Next, we will dig a bit deeper and show that the minimum occurs at exactly 30 degrees, and we will derive a solution in the more general case.

### General solution

For general values of $(r_0,\rho_0,r_1,\rho_1)$, we can look for a value of $\theta$ that minimizes $f(\theta)$ by taking the derivative and setting it equal to zero. However, the algebra is a bit simpler if we do not eliminate $\phi$ and write down optimality conditions using the method of Lagrange multipliers. Doing this and simplifying, we obtain two conditions:

\begin{gather}

\frac{\rho_0\sin\theta}{\sqrt{ r_0^2+\rho_0^2-2 r_0 \rho_0\cos(\theta)}}

= \frac{\rho_0\sin\phi}{\sqrt{ r_1^2+\rho_1^2-2 r_1 \rho_1\cos(\phi)}}

\\

\theta + \frac{r_1}{r_0} \phi = \frac{\pi}{2}

\end{gather}By the law of sines, the first equation says that $\alpha = \angle OXA = \angle PX’B$. Intuitively, this has the following interpretation: If we imagine *rolling* one circle around the other until points $X$ and $X’$ coincide, the points $B,X’,X,O$ will all lie on a straight line (the two red segments form a straight line). By writing out the law of sines on the third side, we can obtain slightly simpler expressions now involving $(\theta,\phi,\alpha)$:

\begin{align}

\rho_0 \sin(\theta+\alpha) &= r_0 \sin(\alpha) \\

\rho_1 \sin(\phi+\alpha) &= r_1 \sin(\alpha) \\

\theta + \tfrac{r_1}{r_0}\phi &= \tfrac{\pi}{2}

\end{align}Expanding the first two equations using angle sum identities and eliminating $\alpha$, we obtain an even simpler set of equations:

\[

\frac{\tfrac{r_0}{\rho_0}-\cos\theta}{\sin\theta} = \frac{\tfrac{r_1}{\rho_1}-\cos\phi}{\sin\phi}

\quad\text{and}\quad

\theta + \tfrac{r_1}{r_0}\phi = \tfrac{\pi}{2}

\]This is pretty difficult to solve in general, but certain special cases make things easier. For example, if $\tfrac{r_0}{\rho_0}=\tfrac{r_1}{\rho_1}$, then we must have $\theta=\phi$. This is precisely the case in the problem statement, because we have $\tfrac{r_0}{\rho_0}=\tfrac{r_1}{\rho_1}=2$. Furthermore, we have $\tfrac{r_1}{r_0}=2$, so the second condition becomes $\theta + 2\theta = \tfrac{\pi}{2}$, from which we conclude that $\theta=\tfrac{\pi}{6}=30^\circ$. Substituting back into the formula for total distance, we find the length of the shortest path:

$\displaystyle

\text{Minimum distance} = f\bigl(\tfrac{\pi}{6}\bigr) = 3 \sqrt{5-2 \sqrt{3}} \approx 3.71794

$

So we can find an analytic solution to this problem whenever the start and end points are the same fraction of the way from the centers of their respective circles!

Alternatively, the angle OXA and the angle PX’B must be equal — because the curve should also be straight at the point where it crosses from the base to the cone. (This is sort of like Snell’s Law.)

That eliminates having to differentiate to optimize the two angles….

Good point! I updated my post to include the simpler equations and the equal-angle intuition. I actually thought of Snell’s law when I was writing up my solution, but I didn’t connect all the dots at the time. This does lead to simpler equations, but I still don’t see a general analytic solution. Seems that’s only possible in special cases, e.g. as in the problem statement when the various radii are rational multiples of one another.

omg, I forgot about Snell’s Law / Fermat’s Principle