LSystems
LSystems is a way to describe the motion of an imaginary turtle, moving forward, then turning right, then moving forward, then doing something else... Each time the turtle moves, it leaves a trail... making up a shape.
The turtle motion is defined by a string of commands, most of them a single letter or sign.
The string : F+F-FLetters not used in the command set are ignored when drawing the shape and are actually used as symbols to be replaced by more complex command strings defined in a set of rules, in an iterative process. Complex equations are built using simple replacement rules.
means go forward (F), turn left (+), go forward (F), turn right (-) and go forward again (F)So you just define a string of commands to start with, the axiom, and a set of rules defining which letters should be replaced and by what they should be replaced with.
Axiom : P
Rule : P=FP
After each iteration, the letter P is replaced in the axiom by the string FP
iteration 1 : axiom = FP
iteration 2 : axiom = FFP
iteration 3 : axiom = FFFP
iteration 10 : axiom = FFFFFFFFFFP and so on... making a straigth line of ten segmentsAs you note, a rule can refere to itself (P=FP) resulting in a cascade of replacements. You can define many rules to be applied one after the other at each iteration, resulting in complex shapes. All the power of LSystems lies in that string replacement process capable of generating iterative forms as well as fractal or recusive ones. A simple set of axiom/rules may generate (grow) a very complex and intricate structure, reminding many organic forms like trees, insects, flowers...
Under construction...