eureka
§ A23

Lindenmayer Systems: The Geometry of Growth

If you look closely at a fern, a tree, or even the branching of your own blood vessels, you will notice a fascinating pattern: the parts look very much like the whole. A small branch of a tree resembles a smaller version of the entire tree. This property is known as self-similarity.

In 1968, a Hungarian theoretical biologist named Aristid Lindenmayer invented a formal grammar to model this very phenomenon. His invention, now called L-Systems (or Lindenmayer Systems), is a mathematical way of describing the complex growth of plants using incredibly simple rules.

How L-Systems Work

At its core, an L-System is a string-rewriting system. It starts with an initial string of characters, called the axiom. Then, it applies a set of rules to replace each character in the string with a new string. This process is repeated over and over again, in steps called iterations.

Let's look at a simple example: algae growth.

Let's trace the first few iterations:

What started as a single character quickly grows into a complex sequence, following a predictable but non-obvious pattern (fun fact: the lengths of these strings follow the Fibonacci sequence!).

From Strings to Shapes: Turtle Graphics

Strings are interesting, but L-Systems truly come alive when we turn those strings into drawings. We do this using something called Turtle Graphics.

Imagine a mechanical turtle sitting on a piece of paper, holding a pen. The characters in our L-System string become commands for the turtle:

Drawing a Fractal Plant

The brackets ([ and ]) are the secret to drawing plants. They allow the turtle to draw a branch, and then jump back to the main stem to draw another branch, without having to retrace its steps.

Using these simple commands, we can create astonishingly complex shapes, such as the Koch snowflake, the Dragon curve, or incredibly realistic-looking fractal trees. The beauty of L-Systems lies in this emergent complexity: complex, natural-looking structures arising from very simple, repetitive rules.

You can try creating your own fractal plants, Koch curves, and dragon curves using simple replacement rules in Experiment 01.