L-Systems (Turtle)

This interactive simulator explores L-Systems (Turtle) in Math Visualization. Lindenmayer string rewriting + turtle: Koch, Sierpinski, Hilbert, Heighway dragon, plant. Use the controls to change the scenario; watch the visualization and any graphs or readouts to connect the model with lectures, labs, and homework.

Who it's for: Best once you already know the basic definitions and want to build intuition. Typical context: Math Visualization.

Key terms

  • systems
  • turtle
  • l systems
  • math
  • visualization

How it works

An **L-system** is a parallel string-rewriting grammar invented by **Aristid Lindenmayer** (1968) to model plant growth. Start with an **axiom** and repeatedly **substitute** every symbol by its production. A **turtle** then walks the resulting string: **F** = step forward, **+/−** = turn by δ, **[/]** = push/pop position. With just a few rules you can reproduce **Koch snowflake**, the **Hilbert** space-filling curve, the **Heighway dragon**, **Sierpinski** triangles and remarkably plant-like trees.

Key equations

stringₙ₊₁ = apply(rules, stringₙ)
turtle: F→step, +→turn(+δ), −→turn(−δ), [/]→push/pop
|stringₙ| = O(bⁿ) where b = max |rule|