Fractal Images
A fractal image is an image that shows self-similarity. This means that the various parts of the image are just smaller, transformed versions of the whole image.
A typical example of a fractal image is the Sierpinski Triangle. (The (0,0) point is at the
lower left corner, the x axis runs along the bottom edge of the picture, and the y axis runs
along the left edge.)
The Sierpinski Triangle is self-similar: The three small triangles are smaller versions of the whole triangle (and so are their parts).
Encoding a Fractal Image
The Sierpinski Triangle has three basic pieces, so it can be encoded by three affine transformations. An affine transformation has this form:
The matrix multiplication rotates, reflects, projects, contracts, dilates, or shears the point it is multiplied against. The added vector translates the result: slides it up/down or left/right.
To encode the Sierpinski Triangle, do these operations:
- Contract the triangle by a factor of 0.5 towards (0,0). This is accomplished by the function:
- Contract the triangle by a factor of 0.5, then slide it right 5. This is accomplished by the function:
- Contract the triangle by a factor of 0.5, then slide it up 5. This is accomplished by the function:
Other fractal images can be encoded in a similar way. The trick is to (1) figure out what was
done to the whole image to get each piece, and (2) write this as a function.
How the Image is Constructed from the Functions
There are two ways.
- The first way:
- Start with any shape in the xy plane, say a box.
- Apply each function to this figure to get three result figures.
- Combine the result figures into one. (Take the union.)
- Go back to 2, and repeat forever. (Ten or so iterations tends to give
good results.)
- The second way:
- Start with any point in the xy plane. Plot it, and call it the "last point."
- Choose one of the functions at random.
- Apply this function to the last point to get another point.
- Plot this point, and call it the last point.
- Go back to 2, and repeat forever. (100,000 iterations tends to give good
results.)
It turns out the two methods give the same result. If you play with the first method, you will probably see why it works.
However, the reason why the second method works is not at all obvious. In fact the reasons are quite deep, well beyond the scope of this course.
How to Work the Fractal Maker
Click on this button to start the Fractal Maker:
- To set up a system of functions, click on Start System. In the entry box that pops up, enter in the number of functions you will make.
- Now the display shows the number of functions and the number of the current function.
- Fill in the matrix and vector entries for your first function.
- Then click on Next Fn to bring up the second function.
- Keep doing this until you have entered in all of your functions.
- Once all of the functions are entered in, click on Draw System to produce the fractal image. In the image (The (0,0) point is at the
lower left corner, the x axis runs along the bottom edge of the picture, and the y axis runs
along the left edge.)