L-System Nature Lab

Grow procedural trees, ferns, algae, vines, and branching plant structures.

← Back to Portal

Branching Tree

Turtle graphics growth

How L-systems recreate nature

1. Start with a seed

The axiom is like the first cell of a plant. It may be only one symbol, such as F, but it contains the starting instruction for the whole shape.

2. Rewrite the instructions

In the simple preset, F becomes F[+F]F[-F]F. Read it as: grow forward, branch right, grow forward, branch left, grow forward.

3. Draw with a turtle

Imagine a tiny robot with a pen. F tells it to walk forward, + and - turn it, and brackets let it jump back to an earlier branch point.

Explanation

Why tiny rules make huge plants

L-systems are powerful because the same rule is reused again and again. That is similar to nature: a tree does not need a blueprint for every twig. It follows repeated growth habits, and complexity appears over time.

What iterations mean

An iteration is one growth generation. At iteration 0, you only have the axiom. At iteration 1, the first replacements happen. By iteration 5 or 6, the instruction string can become thousands of symbols long.

Why brackets create branches

The bracket symbols work like save points in a game. When the turtle sees [, it remembers where it is. After drawing a side branch, ] sends it back so another branch can grow from the same stem.

Try these experiments

  • Raise Iterations one step at a time and watch complexity explode.
  • Change Angle to see branches spread wider or grow taller.
  • Start with Simple Branching Example first. It has no jitter, so the same grammar always draws the same plant.
  • Then turn Jitter up after you understand the pattern. Jitter makes it look more natural, but less predictable.
  • Increase Leaf Density to make tips look alive.