Part II: Fractals
6. L-Systems and Fractal Growth
Read the opening pages · printed page 77
L-Systems (lsys.c)
Lindenmayer systems grow a string by rewriting: every F becomes a longer phrase of Fs, turns, and bracketed side branches, and after a few rounds a turtle walks the string and draws it. The rule for the weed is one line, F=|[-F]|[+F][-F]F, exactly as the book's program takes it on the command line. The same interpreter draws the Koch and Penrose snowflakes, the Sierpinski arrowhead, the dragon, and the Hilbert and Peano curves. Plants here grow in turtle order and sway because the turn angle drifts a little each frame. Full screen →
Sections
- Production Systems
- Turtle Graphics
- Further Exploration
- Further Reading