In this blog post we will create a spirograph using Python Turtle to draw different types of curves.
Did you know?
A Spirograph is a geometric drawing toy that produces mathematical roulette curves of the variety technically known as hypotrochoids and epitrochoids. It was developed by British engineer Denys Fisher and first sold in 1965.
Examples of patterns created using a spirograph:
The parametric equations for a hypotrochoid are:
Where θ (theta) is the angle formed by the horizontal and the center of the rolling circle.
Source: https://en.wikipedia.org/wiki/Hypotrochoid
You can tweak the Python code provided below to change the three key parameters: R, r and d to see their impacts on the hypotrochoid curve.
The parametric equations for a hypocycloid are:
The parametric equations for an epicycloid are:
The parametric equations for an epitrochoid are:
Find out the properties of a Cycloid (https://en.wikipedia.org/wiki/Cycloid) and adapt the Python code (see below) to create your own Cycloid curves.
Python Turtle Spirograph: (Hypotrochoid)
Spirograph Pattern:
By changing some of the parameters (r, R or d) and the number of iterations (steps) we can create more advanced patterns.