Wait… What’s going on?
I know, it looks like black magic. I’ll explain.
First, you need to reflect your function along the line y = x, shown here as an equivalent rotation. This step is necessary because we arbitrarily defined zero degrees at the right. If the convention had been with zero at the top, we wouldn’t need this step.
Once our curve is in place, bend the Y axis around and contract it into a point. The result is the polar graph!
Now, that step is a bit harder to understand. The idea here is that a straight line can be considered (geometrically) as a circle of infinite radius. In a way, it “never curves on itself”.
By bringing the radius from infinity to zero, we turn the Y axis into a circle, which is contracted into a point once the radius reaches zero.
Pretty cool, huh?