I came across an interesting animation the other day.
What's going on here? Why is this possible?
From the author:
A function in the Cartesian plane can be transformed into polar coordinates by wrapping one axis around itself and collapsing it to a point.
Start with Cartesian graph.
Clip the graph to satisfy $y>0$ (not necessary in the example $y=\sin(6x)+2$).
Reflect in the line $y=x$.
Bend it to backwards on itself, as shown in the animation, to obtain the polar graph.
What is meant by bend it backwards on itself and wrapping one axis around itself and collapsing it to a point? Why are steps #2 and #3 necessary?

It was a bit tricky to derive the transformation demonstrated in the animation.
Let us start from a point $(x, y)$ of $y = f(x)$. There are two major transformations:
Let us derive the second transformation in the animation. Let $R > 0$ and consider the circle centered at $(-R, 0)$ with the radius $R+a$. Then, the circle intersects the $x$-axis at $(a, 0)$. Draw a concentric circle with the radius $R+1$. Draw a line segment between $(-R, 0)$ and $(a, 0)$ and rotate it taking $(-R, 0)$ as a pivot, CCW if $b\ge 0$ and CW if $b < 0$, such that the arclength $AB$ equals $|b|$. Therefore, the angle $\theta$ in the figure is $b/(R+1)$. Let $r = (R+a)$. Then, the new coordinate is obtained by $$ \begin{aligned} (p,q) &= (r\cos \theta - R,~r\cos \theta)\\ &= \left((R+a)\cos\dfrac{b}{R+1} -R,~ (R+a)\sin\dfrac{b}{R+1}\right)\\ &= :U_R(a,b) \end{aligned} $$ $T_2$ can be thought of as the limit of $U$: $$ T_2 = \lim_{R \searrow 0} U_R $$ which follows from the definition of $U$. This is just one of the possible instances of $U$.
Note that $\lim_{R \to \infty}U_R$ is an identity map.
For all $(a,b) \in \mathbb{R}_+ \times \mathbb{R}$, $$ \lim_{R \searrow 0} U_R(a,b) = (a \cos b, a \sin b) $$
Comparing the result with the desired one $(y\cos x, y \sin x)$, we know that $T_1$ is indeed needed.
You can think of the circle with the radius $R$ as a bent axis, which collapses to a point (circle degenerates to a point at the origin) as $R \searrow 0$.
The animation shows the result of changing the values of $R$.