Categories

Saturday, September 26, 2009

Flash Fractals (from 11/08)

I saw a NOVA on the subject and wanted to try my own.
I made a flash applet that takes a set of coded turning instructions and draws a line (eg: R, R, L for two right turns, then a left... like the old LOGO thing on the apple IIe!).
The turning instructions are generated by starting with one letter of the code, adding a letter, and then duplicating, mirroring, and inversing the code. So, 1. start with R 2. then add say an R 3. then duplicate the code before the letter you just added, so you have {R,R,R} 4. and also inverse the letters on the duplicated side {R,R,L} 5. do it again! RRL > RRLR > RRLRRLL (that was the second iteration. 6. iterate it 20 times and you'll have a list of instructions just over a million letters long. Have the computer follow the instructions and you get a picture like that over there, the famous Jurassic Park fractal. That's actually a million little lines making a quarter million little squares that add up to this big, bumpy, spirally thing that I guess reminded Michael Crichton (RIP) of a fern.
That's what you get if you stick to 90 degree turns and a two-letter code.

The rest of these (below) are some results from my experiments with 4-letter codes and other angle increments.


Try my Flash thingy for yourself...
Drag the fractal around to keep it on screen, enter different angles, zoom in and out, press space to hide and show the control panel.
If you want to make a Jurassic Park fractal, enter the following angles
A:90 G:-90 T:90 C:-90 start:T add:T
I don't recommend going above 16 iterations! If you do, save whatever else you're working on.









No comments:

Post a Comment