Shortest Path on a Cylinder or Cone
The shortest path on a cylinder or cone is found by unrolling the surface: a cylinder becomes a rectangle, a cone becomes a sector. The geodesic is then a straight line on that flat net.
Unfold the surface and the shortest path becomes a straight line on the flat net. For a cylinder it is the diagonal of the unrolled rectangle; for a cone it is a chord of the unrolled sector.
Shortest paths on curved surfaces (geodesics) are found by cutting and flattening the surface: a cylinder unrolls to a rectangle, a cone to a sector. The shortest route is then just a straight line on that net — this is the standard method for “ant crawling around a can or a cone” problems.
What you are seeing
Cut and flatten the curved surface into a plane.
For a cylinder the net is a rectangle width = circumference; the path is its diagonal.
For a cone the net is a sector; the path is a chord.
Why it matters
This is the standard method for “ant around a can or cone” problems and introduces geodesics on developable surfaces.
Complexity & details
Path length is O(1) from the unfolded geometry.
Frequently asked questions
Why does unrolling preserve lengths?+
Cylinders and cones are developable — they can be flattened without stretching, so surface distances are preserved.