What is the function for "unwrapping" a cylinder onto a plane? And why does it preserve geodesic distance? If a cylinder is described by $ \{ (x,y,z)\in\mathbb{R}:x^2+y^2=r^2 \} $ where $r$ is constant, and the set is "unwrapped" to the rectangle with width $2\pi r$ and, say, with $y=0$, $z$ preserved, what is the function that would correctly map the $x$ coordinate?
For illustration, allow me to borrow from this article. See Figure 4(a). Without the cutting cylinder.
Unwrapping in real life probably means preserving distance between points with the same $x,y$ coordinates on the cylinder and points with the same $z$ coordinate.
But it seems, in effect, distances between any points are preserved under this map. So I am curious why that is.
Or is there a simpler way to see the distance preserving effect?
I got my question upon seeing this recent question, where the solution assumes geodesics on cylinder is preserved under "unwrapping". That much is true, but the reasoning I can think of is not really basic geometry.
 A: $\newcommand{\dd}{\partial}$Let's fix a positive real number $r$ and consider the statement, A cylinder of radius $r$ is locally isometric to the plane. Technicalities are hidden below to make them easier to skip on first reading. (To the casual reader, SE's default tag spoiler therefore refers to fun spoiler. :)
Physical Intuition
The basic physical picture is a flat sheet of paper (a model of a piece of a Euclidean plane) rolled into a tube (a model of a circular cylinder). Intuitively, this mapping is a local isometry because while the paper bends in space, it does not stretch, wrinkle, or tear. By contrast, if we attempt to wrap a flat sheet of paper around a tennis ball (of "positive Gaussian curvature") or a concave vase (of "negative Gaussian curvature"), the paper will wrinkle or tear.
Note 1:

 If we're more careful, physical paper is a thin slab of inhomogeneous medium (cellulose fibers) that does slightly stretch and compress when rolled into a tube: That's why we have to tape the tube closed to prevent it from unrolling if we let go. By "no stretching" in the preceding paragraph we mean something like "no first-order stretching in directions tangent to the flat surface of the paper."

In this physical model, arcs of plane geodesics are arbitrary line segments. Under rolling up, these map to curves on the cylinder that turn out to be circular helices, including degenerate cases of "equatorial" circles and Euclidean "meridian" lines.
The Euclidean distance between points of the plane is not generally preserved under rolling paper into a tube; for example, two points at distance $2\pi r$ may land at the same location on the cylinder. What is true, however, is that if $D$ is a Euclidean disk of radius at most $\pi r/2$, then Euclidean distances in $D$ agree with cylindrical distances in the image of $D$ under wrapping. That's a concrete way to understand local isometry.
Analytic Model
For convenience, introduce Cartesian coordinates $(u, v)$ in the Euclidean plane. To a differential geometer, Euclidean geometry is captured by the first fundamental form
$$
g = du^{2} + dv^{2},
$$
an infinitesimal articulation of the Pythagorean theorem that is "the same at every point."
Consider the mapping
$$
(x, y, z) = f(u, v) = (r\cos(u/r), r\sin(u/r), v).
$$
A short calculation shows the Euclidean space metric $dx^{2} + dy^{2} + dz^{2}$ on the image cylinder corresponds to the Euclidean plane metric $du^{2} + dv^{2}$. In this sense, we can "wrap" the plane isometrically around the cylinder by a mapping, and we can "unwrap" the plane isometrically from the cylinder, though not by a mapping.
Note 2 (local isometry):

 The image of $f$ is the cylinder with Cartesian equation $x^{2} + y^{2} = r^{2}$. The induced metric on the Euclidean plane is the pullback $f^{*}(dx^{2} + dy^{2} + dz^{2})$ of the Euclidean three-space metric, i.e., the result of "expressing $dx^{2} + dy^{2} + dz^{2}$ as a function of $u$, $v$, $du$, and $dv$." Since $dx = -\sin(u/r)\, du$, $dy = \cos(u/r)\, du$, and $dz = dv$, we have $f^{*}(dx^{2} + dy^{2} + dz^{2}) = du^{2} + dv^{2}$, the Euclidean plane metric.

One precise claim that "There is no unwrapping from the cylinder to the plane" is: There exists no continuous mapping $\phi$ from the cylinder to the plane satisfying $f(\phi(x, y, z)) = (x, y, z)$ for all points of the cylinder.
This is a little striking because we can unwrap small pieces of the cylinder, and even some "large" pieces of the cylinder. (Precisely, if $D$ is a subset of the plane on which $f$ is injective--does not send two distinct points to the same location--then the image $f(D)$ is unwrapped to $D$ by "undoing" $f$.)
Intuitively, each point of the cylinder comes from infinitely many "avatars" in the plane; for example, $p = (r, 0, 0)$ in the cylinder is $f(2\pi rk, 0)$ for every integer $k$, so the single point $p$ has avatars $(u, v) = (2\pi rk, 0)$ in the plane. If we try to define $\phi(r, 0, 0) = (r, 0)$ and "extend by continuity," we run into trouble when we traverse the circle $z = 0$: While the point on the cylinder returns to its initial location, its avatar (image under $\phi$) moves to a neighboring avatar.
Note 3 (no mapping from the cylinder to the plane):

 We can define an "unwrapping" from the cylinder to the plane, for example by restricting $f$ to the set of $(u, v)$ with $-\pi r< u \leq \pi r$, but this mapping is not continuous along the line $x = -r$, $y = 0$. For instance, the half-open plane segment $-\pi r < u \leq \pi r$ and $v = 0$ maps bijectively to the circle $z = 0$ on the cylinder, but points "near" $(-r, 0, 0) = f(\pi r, 0)$ with $y < 0$ come from points near $(-\pi r, 0)$, while $(-r, 0, 0)$ itself comes from $(\pi r, 0)$. A careful proof that no continuous unwrapping exists might start by defining $\phi(r, 0, 0) = (0, 0)$, assuming $\phi$ is continuous, and showing that of necessity we have $\phi(r\cos(u/r), r\sin(u/r), 0) = (u, 0)$ for $0 \leq u < 2\pi$. We are forced to a discontinuity of $\phi$ at $(r, 0, 0)$.

Local Isometries and Geodesics
Note 4:

 Geodesics are solutions of a second-order ODE whose coefficients are Christoffel symbols. Since Christoffel symbols are determined "intrinsically" by the metric of a surface despite their apparent dependence on bending, geodesics map to geodesics under local isometry. In my version of Ted Shifrin's Open Math Notes at this writing (Version 2), the details of this story are in Section 2.3, starting on page 57. The version with moving frames is in Section 3.3, starting on page 101.

