Click any card to explore that L-System in the Editor. Each one demonstrates different production rules and branching angles.
An L-System (Lindenmayer System) was invented by biologist Aristid Lindenmayer in 1968 to model plant cell growth. It is a type of formal grammar that rewrites strings of symbols according to rules, then interprets the result as drawing commands — producing fractal-like plant structures.
Every L-System has three parts:
Alphabet — the set of symbols used (e.g. F, +, –, [, ])
Axiom — the starting string (e.g. "F")
Production Rules — how each symbol expands in each generation
| Symbol | Action | Example use |
|---|---|---|
| F | Draw a line segment forward | Branch / trunk |
| f | Move forward without drawing | Jump gap |
| + | Turn right by angle δ | Branch right |
| – | Turn left by angle δ | Branch left |
| [ | Push current position & angle onto stack | Start branch |
| ] | Pop position & angle from stack | End branch, return to node |
| | | Turn 180° | Reversed segment |
| ! | Decrease line width | Taper towards tips |
| X, A, B… | Variable (doesn't draw; expands by rules) | Complex grammars |
Starting from the axiom, each symbol is replaced by its production rule simultaneously. After n iterations you get an exponentially longer string.
The final string is interpreted by a turtle — an imaginary pen that walks forward and turns. The turtle keeps a stack so it can branch and return to the branch point.
Adjusting the angle δ dramatically changes the visual result: small angles → narrow, tall trees; large angles → wide, spreading canopies.