![]() |
Create a Lindenmayer System |
![]() |
Lindenmayer System are the geometric representation of formal grammars. Grammars themselves are sets of simple rules used to transform strings of characters. For example, here 4 rules are applied to the letter "a":
| Rules [1] | Transformation Sequence |
| 1. cb > a | a use 4. |
| 2. aa > a | ba use 3. and 4. |
| 3. b > c | cba use 1. then 4. |
| 4. a > ba | aa use 2. |
| a |
Expressions generated by the grammar may be represented as geometric shapes if there are interpreted as instructions by a graphics plotter robot or "turtle":
| F | move forward, drawing a line |
| f | move forward without drawing a line |
| + | turn left (by rotating clockwise on the spot) |
| - | turn right (by rotating anti-clockwise on the spot) |
| [ | remember the current position |
| ] | return to the last remembered position |
In this language the instruction "F+F+F+F" plot a square (if each turn is 90 degrees). Each straight line may then be transformed to a crooked line with the grammar rule "F" to "F+F-F-FF+F+F-F". After this transformation is repeated just a few times the square becomes a complex shape with fractal geometry (a "Koch island").
Astrid Lindenmayer was impressed by the complexity that emerges from a simple grammar like this. He believed these systems captured a mathematical principles of biological development. This is graphically illustrated by L-systems that generate fern and tree like patterns.
The program below allows you to generate 6 character "turtle" L-systems yourself. You can start by experimenting with the examples [2]. Once your ready to try your own L-system, follow these steps:
There is lots of information about Lindenmayer systems on the web [3](I used a site formerly at Sussex University). Please mail feedback and interesting L-systems you've found to me - this page may itself develop if you do - and thanks for visiting!
Footnotes:
[1] For this example and below longer rules are applied first. Also empty or repeated "from" parts to the rules are not allowed. Above the seed went through longer character strings before returning to the seed. Other rules and seeds may enter a cycle of transformations like this, or may determine the expression grows indefinitely (or becomes empty).Back.
[2] If you find a good system, mail the setup, seed and grammar to me so I can add to these examples.Back.
[3] Try searching for Richard Dawkins' Biomorphs, artificial life and fractals too. The Santa Fe institute are notable champions of artificial life.Back.
| Home | © 2001 Joe L-B |