2

Spirographs

You can use a Spirograph toy (shown in Figure 2-1) to draw mathematical curves. The toy consists of two different-sized rings with plastic gear teeth, one large and one small. The small one has several holes. You put a pen or pencil through one of the holes and then rotate the smaller wheel inside the larger one (which has gear teeth on its inside), keeping the wheels in contact with each other, to draw an endless number of complex and wonderfully symmetric patterns.

In this project, you’ll use Python to create an animation of Spirograph-like curves. The program will use parametric equations to describe the motion of a Spirograph’s ...

Get Python Playground, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.