|
|||||||||||||||||||||||||||||||||||||||
What a wealth, what a grandeur of thought may spring from what slight beginnings -- H.J. BakerAnother great quote, which one could use to describe fractals, although it wasn't what Mr. Baker had in mind. In this section we'll describe a very simple method, used by computer programs, to take very simple rules and definitions (slight beginnings) to generate complex looking fractals (grandeur). Have you noticed how the branches of some plants branch out in very regular patterns? A main branch might branch into two, then each into another two, again, each new one into another two, etc. If you also look at the arrangement of the leaves, you'll notice that they can be organized in very nice patterns. Go out into the garden or use a book on plants to check this out. Before
reading any further, try to describe a mechanism that any particular plant
might follow to accomplish its growth. As if someone had decided how the
plant ought to grow and gave it precise instructions to follow!
L-systems. This is what A. Lindenmayer was trying to do in 1968. He was trying to describe the growth process of living organisms such as branching patterns of plants. The process that he developed is known as an L-system2. This is described below and it is used on the Koch Curve Java applet in the next page. Start with a line, then decide what operation you want to do to the line. This will probably result in a figure with more lines. Repeat the same operation on each of the lines of the new figure. Pretty simple, right? Now, lets use the following set of figures to describe an actual process. We start with a line. The mathematicians call the starting definition an axiom: We now have to define some type of transformation, called production rule by mathematicians. Lets add a square bump in the middle of the line. To make it keep the same overall size, the length of the lines used to form the bump are one third the length of the original one. Here is the resulting line with its bump or first stage: We do this recursively (right?) to each of the five lines in the last figure to come up with the second stage or iteration of this fractal, which I call the Stairs fractal. Can you see how the fractal grows from the first to the second iteration? By looking at this second iteration it might be pretty hard to figure out what the axiom and production rules are. You may want to try to draw the fourth iteration using ruled paper. It is pretty hard to keep track of where you are. Now imagine trying to do a few more iterations. Mathematicians like to express these ideas using symbols, which is normal characters with special meanings. This is useful especially when trying to implement these ideas with computers. If you tried to draw the fourth or fifth iteration, you'll understand why computers are used to do this. The great thing about L-systems is that they use very few simple symbols to describe both the axiom and the production rules. So here are the first three symbols that we'll
use:
Lets use the following figure to see how one would use these symbols: If you wanted someone to draw this shape, without them seeing it, you would first have to tell them three things:
These are called the initial conditions. After that you can start drawing the shape. If the person knew the special symbols from the previous table, you would instruct them to do the following sequence of operations (remember the initial conditions): F - F In this case we drew the shape starting from the lower-left corner. How would things change if you wanted to start from the upper-right corner? OK. By now you should be able to draw figures given a sequence of F,
+, and - characters. Now, as the final step, lets define the generation
of the Stairs fractal using this mathematical language. The complete description
is in this table:
What the production rule is saying is to replace every line (or every F)
with the string sequence: F-F+F+F-F. To complete the illustration, lets
show mathematically how the Stairs fractal (or the string describing it)
grows:
This is also called a string replacement algorithm, because as you can see, to go from one iteration to the next (i.e. to come up with the new string), you replace each F in the original string with the corresponding production rule. If you tried to draw the third iteration by hand but got lost in the process, take the corresponding string from the table above and simply follow the instructions one by one.Lets now move on to do a bit of fractal math before we do some actual hands-on growth of various fractals with Java programs.
|