1) What Is Recursion?
Recursion means a process repeats the same rule on a smaller version of itself. In programming, this usually means a function calls itself.
- Base case: the stopping condition (prevents infinite recursion).
- Recursive step: call again with a smaller/simpler input.
- Depth: how many levels of detail are generated.
2) Iterative vs Recursive Styles in SWSnowFlake
In the demo, some styles are loop-based and some are truly recursive:
- IterativeStellar Dendrite, Fern Dendrite, Plate Crystal, Needle Cluster
- RecursiveKoch Crystal, Recursive Dendrite
Iterative styles use fixed lists of branch positions. Recursive styles generate details by repeated self-calls.
3) Koch Crystal: How It Grows
The Koch method starts with a segment and replaces the middle third with a triangular bump. Then it does the same replacement on each new segment.
| Depth | What You See | How Many Segment Replacements |
|---|---|---|
| 0 | A simple straight arm | 0 |
| 1 | One triangular bump | 1 |
| 2 | Bumps on bumps | 4 |
| 3 | Clearly fractal edge | 16 |
| 4+ | Very detailed crystalline edge | 64 and up |
4) Recursive Dendrite: How It Grows
Recursive Dendrite grows like a tree branch: one trunk creates smaller branches at angles, and each of those branches repeats the same rule.
- Branch scale: how much smaller each generation becomes.
- Branch angle: how wide each split is.
- Recursion depth: how many generations are created.
Small angle values make narrow, needle-like crystals. Larger angle values make wider, bushier crystals.
5) Guided App Recipes
Use the snowflake demo at SWSnowFlake Demo and try these exact settings.
- Style: Koch Crystal (Recursive)
- Arms: 6
- Recursion depth: 1
- Radius: 5.5
- Spin speed: 0
- Style: Koch Crystal (Recursive)
- Arms: 6 or 8
- Recursion depth: 3 or 4
- Radius: 6.5
- Spin speed: 10 to 25
- Style: Recursive Dendrite (Recursive)
- Recursion depth: 2
- Branch scale: 0.58
- Branch angle: 30 to 35
- Arms: 6
- Style: Recursive Dendrite (Recursive)
- Recursion depth: 4
- Branch scale: 0.65
- Branch angle: 40 to 52
- Border thickness: 0.6 to 1.2
6) Coaching Guide: How to Explore Intentionally
- Lock one variable: keep everything fixed except one slider.
- Run depth sweeps: test depth 0, 1, 2, 3, 4 and record observations.
- Compare algorithms: build one iterative and one recursive design with similar colors and radius.
- Add motion last: once shape behavior is understood, then add spin and SWBug motion.
7) Practice Challenges
- Create two designs with the same depth but different branch scales. Describe exactly what changed.
- Build the "smallest" recursive snowflake that still looks clearly fractal.
- Recreate a design after closing the page using only your notes.
- Explain why depth 6 can feel slower than depth 3 in your own words.
8) Reflection Questions
- Where is the base case in Koch Crystal?
- What values control self-similarity in Recursive Dendrite?
- How can recursion create beauty and also create performance cost?