Points on the cone on a cone are defined by $$ p=(\theta,z) $$ where $\theta$ is the angle around the cone and $z$ is the distance along the axis. I have a segment $S$ defined from $p_0$ to $p_1$ on the cone. To remove ambiguity the segment is defined as the shortest way across the cone. That is a segment can't wrap more that $\pi/2$ round the cone. ( Though extra points for solving the more general problem. There are an infinite number of geodesics between two points on a cone equivalent to spiral sections with decreasing pitch. )
The cone is defined as the surface of revolution around axis $z$ generated by the line $$ r = gz + r_0 $$ where
- $r$ is the cone radius at position $z$ along the cone axis and
- $g$ is the slope of the cone
- $r_0$ is the radius of the cone at $z=0$ Only the part of the cone up to the point where the line crosses zero is considered. ie: only the single cone not the dual cone.
So now given some point $p$ what is the closest point to $p$ on $S$.