When you mention fractals, one of the things that immediately comes to mind for most people
is fractal landscapes. We’ve all seen amazing images of mountain ranges, planets, lakes, and things
of that sort that were generated by fractals.
Seeing a fractal image of a mountain, like the one in this image (which I found
here via a google image search for “fractal mountain”), I expected to find that
it was based on an extremely complicated fractal. But the amazing thing about fractals is how
complexity emerges from simplicity. The basic process for generating a fractal mountain – and many other elements of fractal landscapes – is astonishingly simple.
The basic idea is standard fractal self-symmetry, with a dash of randomness. Remember the basic
Koch curve? In a Koch curve, we took straight line segments, and replaced them with a new structure made
of a slightly more complex set of segments – and then replaced those, and so on, like in this image. By introducing a bit of randomness, you can get some pretty compelling coastlines, as you can see in my
original post on the Koch curve.
For landscapes, you need to be a bit more sophisticated than that – but not by much. For a two dimensional image of a mountain, you use a simple slightly randomized process – a randomizing L-system.
The basic idea is to start with a triangle; and to subdivide it into smaller triangles by dividing each edge into two sub-segments, and then creating a triangle that connects the point where the sub-segments meet. As a non-random geometric L-system, here’s the replacement rule:
All we need to do is randomize that slightly. When we divide an edge into two sub-segments, we’ll
move their connection point slightly. Just look at the pictures to see two steps of the process. Repeat that 10 times, and you’ve got an amazingly detailed image of a mountain.
Now, suppose you want a real three dimensional mountain. Start with a triangle. Grab a point inside the triangle, and randomly move it. Then draw a line from each corner of the original triangle to that point. You’ve replaced the triangle with a sort of irregular pyramid. Each of the faces is a triangle. Repeat the process with them. Keep doing that. If you set the parameters correctly for the randomizer which determines how far to point relative to the size of the triangle, you can get an amazing image of