Epicycles: The Equations

Introduction

Normal spirographs (that is those drawn using the plastic wheels) can be described by the equations

x (theta) = A x Cos (n1 x theta) + B x Cos (n2 x theta)
y (theta) = A x Sin (n1 x theta) + B x Sin (n2 x theta)

where 'A' and 'B' relate to the distance of the holes from the centres of the wheels and 'n1' and 'n2' to the number of teeth. 'theta' is the variable parameter. In the case where 'n1' and 'n2' are integers varying 'theta' from 0 to 2 pi will draw a complete pattern.

The patterns drawn by the applet extend the model by simulating additional wheels that revolve around the first two. It also does't suffer from the physical constraint of having to fit the teeth round the edges of the wheels and there are some additional ways of drawing the patterns, see below.

The Draw Modes

There are five ways the patterns may be drawn

Standard: Successive points are joined by a line as with a normal pattern. A modification allows alternate segments to be drawn in different colours.

Filled: The pattern is drawn as a continuous line and the inside is coloured in.

Joined: Points for two patterns are calculated. One uses all the wheels, the other all the wheels but one. Lines are drawn between corresponding points in the two patterns.

Double: Points for two patterns are calculated as in "Joined" but now the two patterns are draw as separate continuous lines.

Spotty: Points for two patterns are calculated as in "Joined" but now spots are drawn at the point positions.

Evolution

The evolution algorithm changes one aspect of the pattern at random. Some of the options are;

Add a random wheel
Remove a wheel
Change the size of a wheel
Change the phase of a wheel
Change the number of teeth on a wheel
Change the number of points used to draw the pattern
Change the colours
Change the way the pattern is drawn