Fun With Fractals

I'd always had a vague understanding that fractals were generated from simple rules, but I don't know if I realized how simple. I recently ran across a great book called The Algorithmic Beauty of Plants by Przemyslaw Prusinkiewicz and Aristid Lindenmayer, which is available as a free download.

Right from the first page they provide a very simple example of how to generate a fractal, specifically the Koch snowflake: start with a line, and each step, replace that line with a simple shape:

This basically involves splitting each line into thirds, and creating a triangle out of the middle third. That seemed like something I could try out for myself quickly, so I put together this simple demo (mostly in the course of a lunchbreak):

Without the ability to zoom in this as a bit limited, as you can't see the fractal continue to grow at smaller levels - that's definitely something I'll be exploring in future.