L-Systems: Patterns with Grammar

Koch curve example

Take the alphabet A = {F, +, -}, the axiom S = F, and the production rules

F -> F-F++F-F
+ -> +
- -> -

One step produces the string F-F++F-F, two steps produce

F-F++F-F-F-F++F-F++F-F++F-F-F-F++F-F

To express these strings geometrically, we need interpretations of the symbols. For this example, we take these

F means move one step forward while drawing a line
- means turn counterclockwise by 60 degrees
+ means turn clockwise by 60 degrees

Starting from a horizontal line segment, here are the geometric realizations of the first three steps. To keep the picture from becoming too large, we adopt the convention of rescaling the length of the line segments so each step occupies about the same size space.

Return to Background