Fibonacci Spiral¶
By the end of this lab you'll be able to:
- Generate the Fibonacci sequence in code and use its values as arc radii
- Build a spiral from quarter-circle arcs that pivot 90° at each step
- Understand why the Fibonacci sequence appears in seashells, sunflowers, and pine cones
Quarter-circle arcs of radii 1, 1, 2, 3, 5, 8, 13, 21, 34, and 55 tile together perfectly — each arc pivoting 90° into the next. The famous golden-ratio spiral emerges from the simplest number sequence.
Welcome to the Fibonacci Spiral!
Fibonacci numbers appear everywhere in nature — the spirals in a sunflower head,
the chambers of a nautilus shell, the arrangement of pine cone scales.
In this lab you'll build the spiral yourself! Let's code it together!
How It Works¶
The Fibonacci sequence starts 1, 1 and each new number is the sum of the two before it: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 …
Each step: 1. Draw a quarter-circle arc with the current Fibonacci number as the radius 2. Turn left 90° so the next arc starts from the correct corner 3. Advance to the next Fibonacci number
The arcs all fit together because each radius equals the sum of the previous two — which is exactly how the tiling squares fit.
Sample Code¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
What Do You Think Will Happen?
The first arc has radius 1 (× 4 scale = 4 pixels). The last has radius 55 (× 4 = 220 pixels).
Will all 10 arcs fit on the screen, or will the last one go off the edge?
Make your guess — then click Run to find out!
Try It Now¶
With scale = 4, the largest arc has radius 220 pixels and just fits on a standard turtle canvas. Were you right?
How It Works¶
a, b = b, a + b is a simultaneous assignment that advances the Fibonacci sequence in one line. After the assignment, the old b becomes the new a, and the new b is the sum.
monty.circle(a * scale, 90) draws exactly one quarter-circle (90°). The turtle ends up 90° rotated from where it started — positioned perfectly for the next arc.
Explanation Table¶
| Line | What it does |
|---|---|
a, b = 1, 1 |
Start with the first two Fibonacci numbers |
monty.circle(a * scale, 90) |
Draw a quarter arc — radius = Fibonacci number × scale |
a, b = b, a + b |
Advance: new a = old b, new b = old a + old b |
scale = 4 |
Multiplier to make the spiral fill the canvas |
The Golden Ratio
As the Fibonacci sequence grows, the ratio of consecutive terms (e.g. 55/34 = 1.617…)
gets closer and closer to φ ≈ 1.618 — the golden ratio. That's why the Fibonacci
spiral looks so similar to the true golden spiral found in nature!
Learning Check¶
Spot the Bug!
The program below draws arcs that all have the same radius — no spiral!
Find the bug and fix it so each arc uses the correct Fibonacci radius.
Change monty.circle(scale, 90) to monty.circle(a * scale, 90) — the radius must be a * scale so each arc uses the current Fibonacci number.
Experiments¶
-
Draw more arcs. Change
range(10)torange(12)and extend thecolorslist. You'll know it worked when two extra arcs appear (but they may go off the edge!). -
Change the scale. Try
scale = 2orscale = 6. You'll know it worked when the spiral shrinks or grows to fit the canvas differently. -
Draw only the arcs, no color. Replace
monty.color(colors[i])withmonty.pencolor('black'). You'll know it worked when the spiral is a clean black curve. -
Use semicircles. Change
90to180incircle(). Each Fibonacci segment becomes a half-circle. You'll know it worked when the curve looks very different.
You Found the Golden Spiral!
The Fibonacci sequence is one of the most famous patterns in mathematics and nature.
Now you know it's just: a, b = b, a + b — repeated over and over!
Up next: Spiral of Spirals — arranging many small spirals in a circle.