# Spirograph

Experiment with different values for R, r, and p by using the sliders (or click on a slider and use the left and right arrow keys). Then grab the angle $\theta$ slider to draw the curve, or right click on the $\theta$ slider and choose "Animation On". The curve is generated by rolling one circle inside or outside another fixed circle, with a pen placed somewhere inside the moving circle. If the radius of the fixed circle is R, the radius of the moving circle is r, and the pen is placed at a distance p from the center of the moving circle, then the curve is generated by the following polar equations for the x and y coordinates: $x = (R + r) \cos(\theta) + p \cos((R + r) \theta / r)$ $y = (R + r) \sin(\theta) + p \sin((R + r) \theta / r)$