Fractal Tree Explorer¶
Run the Fractal Tree Explorer MicroSim Fullscreen
Edit in the p5.js Editor
About This MicroSim¶
The chapter's turtle fractal requires an edit-and-rerun cycle for every parameter change; this explorer closes the loop with three sliders. Each recursion level is tinted its own color (brown trunk to green twigs), which turns the depth slider into a live demonstration of recursion levels. The "recursive calls" counter roughly doubles with every +1 depth — connecting the tree's beauty back to the call stack — and Snapshot keeps a gray ghost so students can compare designs.
Learning objective: The student will be able to demonstrate how branch angle, depth, and shrink factor shape a recursive tree and design a tree of their own.
- Bloom's Taxonomy (2001): Apply → Create — demonstrate, experiment, design
- Interaction pattern: parameter sliders with immediate redraw, plus snapshot comparison
How to Use¶
- Predict what the call counter does when depth goes from 6 to 7, then drag and check (it roughly doubles: two recursive calls per branch).
- Sweep the angle slider from 10° to 60° — from poplar to banyan.
- Click Snapshot, change one slider, and compare against the ghost.
- Design challenge: make a weeping willow (big angle, high shrink), then a scraggly bush (Randomize and refine).
Iframe Embed Code¶
You can add this MicroSim to any web page by adding this to your HTML:
1 2 3 4 | |
Lesson Plan¶
Grade Level¶
Upper elementary and middle school (ages 10-14), Chapter 24 (Recursion and Fractals)
Duration¶
10-15 minutes
Prerequisites¶
- The recursive turtle tree program (Chapter 24)
- The call stack model (Recursion Call Stack MicroSim)
Activities¶
- Doubling hunt (4 min): Students record the call count at depths 4, 5, 6, 7 and describe the pattern (2^(depth+1) − 1).
- One-slider studies (4 min): Change only the angle, then only the shrink; students write one sentence per slider about its visual effect.
- Design gallery (5 min): Each student snapshots their best tree and records its three parameter values for a partner to reproduce.
Assessment¶
- Student predicts the approximate call count for a given depth
- Student can map each slider to its line in the chapter's draw_tree code
- Student can reproduce a target tree from its three parameters
References¶
- Wikipedia — Fractal canopy — the fractal family this tree belongs to
- p5.js — the JavaScript library used to build this MicroSim