Initial Direction: Sets the initial direction of moves where 0° is East,
90° is North, 180° is West, and 270° is South.
Direction Increment: Sets the direction increment in degrees. The symbol '+' in a rule increase
the direction by this amount and the symbol '-' decreases the direction by this amount.
Evaluation Level: Sets the number of times the L-System's rules are applied to the the starting expression
called the Axiom. The length of the generated expression can grow dramatically as the level increases.
Use Colors to Indicate Change in Direction: When checked, each time a '+' or '-' is encountered in the L-System
expression being plotted, a new plotting color is selected from one of nine possible colors.
L-System Rules These are the rules to generate the L-System expression
that is plotted. There are four rules
Axiom := exp, F := newF, U := newU, X:= newX, Y := newY
The rules are formed from ONLY these symbols
'F', 'U', 'X', 'Y', '+', '-', '[', ']'.
You can change the current L-System's rules by editing the expressions and the pressing the Set button.
Similarly, you can also use the Initial Direction, Default Direction Increment spinners
and the Maximum Evaluation Level slider to change the current L-System's default values for these quantities.
You can restore the current L-System to its original state by pression the Reset button.
Theory
For information about how L-System expressions are generated and used to draw fractal-like plots,
see the Theory tab.
Generation of the L-System expression
Starting with the axiom expression, the rules are used to generate a new string.
To do this, the axiom string is read character by character from left to right. If a character
matches the left-hand side of a rule, then that character is replaced by the expression
on the right-hand side of the rule in the new string. The newly generated string is called the
first level (or first generation) string. The rules then can be applied again as above to first level
string to generate the second level (or generation) string. Thus, this process can be repeated to
generate strings of levels 3, 4, and so on.
Plotting the L-System expression
The L-System expression is used to draw a fractal like plot. To draw the plot, a moving pen is initialized
to a given starting position, starting direction, and starting color. Next, the L-System expression
is read from left to right symbol by symbol. Except for X, Y, each symbol represents a
instruction to control the pen as follows:
F: Draw a line segment in the current direction of the current length.
U: Move in the current direction one step of the current length.
+: Change the current direction of pen movement by rotating counterclockwise by the angle increment.
–: Change the current direction of pen movement by rotating clockwise by the angle increment.
[: Save the current state of the pen.
]: Restore the pen's to the one saved when the corresponding '[' was
read.
The X, Y symbols are used to give more flexibly in generating L-System expressions and
are ignored when plotting. The '[', ']' pairs make it possible for the
plots to be fractal-like; that is, the entier plot can be formed from smaller simpler
versions of the plot. If the Use colors to indicate change of direction checkbox is checked, then the pen's color
is changed each time a + or – is encountered.
References
Richard M. Crownover, Introduction to Fractals and Chaos, Jones And Bartlett, 1995.
Przemyslaw Prusinkiewicz and Aristid Lindenmayer, The Algorithmic Beauty of Plants, Przemyslaw Prusinkiewicz, 2004.