About | Work | C.V. | Misc. | Ack.

Work > Spirograph

Code, 2005.

The form drawn by the applet is a hypotrochoid, or spirograph. A hypotrochoid is a relative of a cycloid. The cycloid, a simpler form, is generated by tracking a point on a circle as the circle rolls along a straight line. A cycloid looks like a series of hops. The hypotrochoid is a cycloid that's been made inside a circle instead of on a straight line. In addition there's an offset parameter that places the point that is traced off of the circumference of the rolling circle.

The parametric equation for the hypotrochoid is as follows:

Where R is the radius of the circle around which the rolling circle rolls, r is the radius of the rolling circle, and O is the distance of the traced point from the circumference of the rolling circle. Each parameter is graphically represented as a dot that you can click and drag. The effect of your movements are reflected in the numeric display at the upper left.

The really interesting stuff occurs with very small values for r and very large values for O but this is not entirely because those are interesting hypotrochoids, it's just a rendering artifact. The applet draws a line between each sample point, and when the sample points are not close enough together you get jagged lines instead of smooth curves. But, hey, it still looks cool.

Wolfram provides a great discussion of the math involved. Here is another spirograph applet that also inspired me.

Code

The source code was developed in the a now ancient version of the Processing development environment.