Home▸Articles▸Biology & Life

2D L-Systems: Exploring Fractal Geometry Through String Rewriting

Lindenmayer systems, or L-systems, are a formalism used to model plant growth and generate fractal patterns in computer graphics.

mysimulator teamUpdated June 2026≈ 4 min read▶ Open the simulation

What Are Lindenmayer Systems?

Lindenmayer systems, introduced by Aristid Lindenmayer in 1968, are a type of formal grammar used to model the growth processes of plant development. They consist of an initial string (axiom) and a set of production rules that specify how each symbol in the string should be replaced with new strings. These rules can include symbols for drawing lines (F), turning left (+), or right (-), and pushing and popping states ([, ]).

The power of L-systems lies in their ability to generate complex patterns from simple initial conditions and production rules, making them a valuable tool in computer graphics, particularly for simulating natural phenomena.

How Do L-Systems Work?

In an L-system, the process begins with an axiom, which is a string of symbols. Each symbol can be replaced by another string according to predefined production rules. For example, in the classic Koch curve, the rule might be 'F -> F+F--F+F', where 'F' represents drawing forward and '+' and '-' represent turning left or right respectively.

The process of applying these rules is called an iteration. After each iteration, the string becomes longer, and when interpreted by a turtle graphics system, it generates more complex patterns. By adjusting parameters like the angle of turns and the length of lines, one can control the shape and complexity of the resulting fractal.

live demo · related simulation● LIVE

Why Are L-Systems Important?

L-systems are important because they provide a simple yet powerful framework for generating complex structures. They have applications in various fields such as computer graphics, botany, and even architecture. For instance, the fractal plant L-system can be used to model realistic tree growth in video games or virtual reality environments.

Moreover, L-systems are not limited to modeling plants; they can generate a wide variety of fractal patterns, including the famous Koch curve, dragon curve, and Sierpinski triangle. These patterns have both theoretical significance and practical applications in areas like data compression and algorithm design.

Real-World Examples

One notable application of L-systems is in the modeling of natural phenomena such as the growth of plants, where each iteration simulates a stage in plant development. The Koch curve, for example, can be used to model coastlines or snowflakes, while the dragon curve has applications in data compression and error correction.

In computer graphics, L-systems are used to create realistic landscapes, simulate natural growth processes, and generate intricate patterns for visual effects.

Frequently asked questions

How do I create a custom L-system?

You can define your own L-system by specifying an axiom (initial string) and production rules in the provided text fields. Each rule should follow the format 'symbol->replacement', where symbols are replaced according to their definitions.

What is the significance of the angle parameter in L-systems?

The angle parameter determines how much the turtle turns at each step, which significantly affects the shape and complexity of the generated fractal. Smaller angles produce more intricate patterns, while larger angles result in simpler, more linear structures.

Can I use L-systems for other purposes besides generating fractals?

Absolutely! L-systems can be used to model a wide range of natural phenomena and generate complex patterns. They are particularly useful in computer graphics, botany, and even architectural design.

What is the difference between 'F' and '+' or '-' symbols?

'F' represents drawing forward by a certain line length, while '+' and '-' represent turning left or right by a specified angle. These symbols are interpreted by the turtle graphics system to generate the final fractal pattern.

Try it live

Everything above runs in your browser — open 2D L-Systems — Flat Lindenmayer Turtle Fractals and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open 2D L-Systems — Flat Lindenmayer Turtle Fractals simulation

What did you find?

Add reproduction steps (optional)