# What is the shortest path equation between 2 points on a cone?

What is the shortest path equation between 2 points (from A to B) on a cone surface?

$A= (x_1,y_1,z_1)$ and $B=(x_2,y_2,z_2)$ and cone equation is $x^2+y^2=r^2z^2$

I know that the shortest path is a line on the cone surface as shown below but I do not know how to convert it to 3D curve path equation.

-

Since you know it's a line on the unrolled surface, what you need is the transformation from that surface to the actual surface. Using $r$ for the slope of the cone seems a bit confusing; I'll take the liberty to rename that to $m$ and use $r$ for the distance from the origin as usual.

The opening angle of the cone is $\alpha=\arctan m$. The point $(r\cos\phi,r\sin\phi)$ on the unrolled surface corresponds to the point $(r\sin\alpha\cos(\lambda\phi),r\sin\alpha\sin(\lambda\phi),r\cos\alpha)$ on the cone, where the factor $\lambda$ between the angles in the plane and the angles on the cone is determined by the condition that the circles on the cone have $\sin\alpha$ times the length that they would have in the plane, so we need $\lambda=1/\sin\alpha$.

Now use the polar equation for a line,

$$r=\frac{r_0}{\sin(\phi-\phi_0)}\;,$$

to find the equation of the geodesic on the cone, parametrized by $\phi$:

$$\vec x(\phi)=\frac{r_0}{\sin(\phi-\phi_0)}\pmatrix{\sin\alpha\cos\frac\phi{\sin\alpha}\\\sin\alpha\sin\frac\phi{\sin\alpha}\\\cos\alpha}\;.$$

Here's a plot for $\alpha=\pi/10$, $r_0=1$, $\phi_0=0$.

P.S: Perhaps I should add that while your image of the cone rolled out on a plane shows the cone once, we can continue across the boundaries in your image and keep wrapping around the cone, with the angle on the cone always changing by $1/\sin\alpha$ times the change of $\phi$ in the plane. Since a line subtends exactly an angle of $\pi=(2\pi)/2$ with respect to the origin (unless it's a line through the origin, which would simply map to a straight line through the apex of the cone), every geodesic on the cone wraps around the cone exactly $1/(2\sin\alpha)$ times.

-

Some work is needed, I give just a start..

First, you should transpose the carthesian 3d coordinate on polar 2d coordinate for the projection of the cone on the plane. The distance is just the distance between the origin and the point on the cone so:

$$d=\sqrt{x^2+y^2+z^2}$$ For finding the angle you need to impose that a circle at $r^2z^2=1$ (that is long $2\pi$) mantain his lenght when transposed into an arc in polar coordinate ($=d*\alpha$). $$\theta=\frac{1}{\sqrt{1+r^2}}\arctan (y/x)+\theta_0$$

Now you need to introduce 2d cartesian coordinate on the projection, setting: $$X=d*\sin(\theta)$$ $$Y=d*\cos(\theta)$$

Now you should convert $(x,y,z)\rightarrow(X,Y)$, find the equation of the line in $(X,Y)$ and then do the inverse transformation $(X,Y)\rightarrow(x,y,z)$.

Some care are needed for chooing the angle $\theta_0$, the easier choice is putting one of the two point at $\theta=0$, and choosing what geodesic (there are a lot of them, take a look here). Analitically do the invertion don't seem easy, depends on what are you are interested on (finding the equation in $x,y,z$? finding the equation in polar 3d coordinate (that should be easier)? calculate the lenght of the geodesic(that can be done in 2d coordinate)?).

edit: take a look also at this PDF.

-