\[x=(R-r)\cos\theta+d\cos\left(\frac{R-r}{r}\theta\right)\]
\[y=(R-r)\sin\theta-d\sin\left(\frac{R-r}{r}\theta\right)\]
Where $\theta$ is the angle formed by the horizontal and the center of the rolling circle (note that these are not polar equations because $\theta$ is not the polar angle).
Special cases include the hypocycloid with $d=r$ and theellipse with $R=2r$
The classic Spirograph toy traces out hypotrochoid andepitrochoid curves
.
