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 slider to draw the curve, or right click on the 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: