Fractal Lab

Lindenmayer systems

L-systems

Aristid Lindenmayer introduced L-systems in 1968 to model plant growth. A symbolic axiom is rewritten in parallel at every step by applying production rules; the resulting string is then interpreted by a turtle that walks and turns, drawing the fractal as it goes.

An L-system at iteration 4: axiom F++F++F with rule F → F-F++F-F at 60°, drawing the Koch snowflake.

At a glance

InventorAristid Lindenmayer, 1968
Original motivationModelling cell division in algae
Formal classParallel string-rewriting grammar
Common variantsD0L (deterministic context-free), stochastic, parametric, 3D

How an L-system works

  1. Axiom: a starting string, e.g. F or F++F++F.
  2. Production rules: each symbol can be replaced by a string, e.g. F → F+F−F−F+F.
  3. Iteration: apply every rule to every symbol in parallel. After n steps the string can be exponentially long.
  4. Turtle interpretation: walk through the final string. F G A B step forward (drawing); + − turn by a fixed angle; [ ]push and pop the turtle’s position and heading on a stack so the curve can branch.

Classic examples

Why parallel rewriting matters

In a context-free grammar, derivation is sequential, one symbol at a time. L-systems rewrite all symbols simultaneously at each step, modelling biological cells that divide together. Mathematically this means an L-system step is a homomorphism on strings, and string length under iteration is governed by the rule’s growth matrix.

Try it

The L-system playground renders any of seven classic systems with adjustable iteration depth.

References

Test Your Knowledge

Quick MCQ check on this topic (10 questions)

Start Quiz →

AI Summary

Summarize this page in your favorite LLM