Ferns, Sierpinski's Gasket, etc.
This Java applet draws fractals based on iterated function systems (IFS) where the IFS consists of a set af affine transformations. Geometricly, affine transforms are a combination of scaling, rotation, and translation; algebraicly they can be described by equations of the form x' = a0x + b0y + c0,
y' = a1x + b1y + c1.
This is usually written in matrix form as.
As an example, consider a line segment in the x-y plane. If each point (x, y) on that segment is plugged into the transformation, a new set of points (x', y') is generated. Since the equations are linear (first power in x and y), the new points will also form a line segment, but that line segment may be turned at a different angle (rotated), start at a different point (translated), and may be longer or shorter than the original (scaled). If the new segment is shorter, the transformation is called a contraction mapping, and these are the types of transforms that can be used to generate fractals.
Iterated function systems:
A function system consists of several transforms, each transform containing two equations (one to transform the x-component, another for the y-component). An iterated function system starts with a seed point (x0, y0), plugs these values for x and y into one of the transforms to compute a new point (x', y'), then plugs (x', y') into a transform to compute yet another point, and continues this process a given number of times. In computer jargon, each step that generates a new point is called an iteration; hence the term iterated function system. If each step randomly selects a transform from the list to compute the next point and plots each point as it moves along, a fractal is generated (as long as each transform is a contraction mapping as noted above).
How to use this applet:
Clicking the button marked "Fractals" in the lower right corner generates a list of several classic fractals. Click on an item in the list to plot that fractal. To zoom in, drag a rectangle with the mouse around the area you want to see. After about a second, the applet redraws a magnified image of the area you selected and new values appear in the boxes labelled "xmin", "xmax", "ymin", and "ymax" (zooming can also be achieved by decreasing the values in these boxes directly and clicking "Draw"). If the image is grainy, add more points by increasing the number in the text box labeled "# points" and clicking the "Draw" button. The default value is 100000 and increasing this to 1000000 (simply adding a zero) usually sharpens the image without slowing down the plotting process too much. To pan out, click the "Zoom Out" button or increase the values in the "xmin", etc. boxes.
Fractals not on the list may be added using the "Enter coefficients:" boxes at the top of the applet. Fractal formulas are usually given as a set of matrix equations as noted above. The boxes are layed out in this matrix form, allowing numbers to be entered directly as they appear on the page. To enter the transforms, first click the "Clear" button to delete any old transforms (any numbers appearing in the large text area should disappear), type the coefficients (a0, b0, etc.) directly into the text boxes (don't hit the "Enter" key). When all six numbers are entered, click the "Enter" button and the six numbers should appear in the text area. Continue in this manner until all transforms are entered, then click on "Draw" to plot the fractal.
Numbers appearing in the text area can be edited to correct errors in data entry. Simply make the necessary changes in the same manner as any word processor, then click the "Correct Input" button to make the changes take effect. This also provides a second method of entering data. First clear the text area using the "Clear" button, type in the six numbers for each transform (separated by commas), hit the "Enter" key to start a new line, then repeat the process for each transform. When finished, click on "Correct Input" to plot the fractal. Numbers must be entered in the sequence a0, b0, a1, b1, c0, c1 corresponding to the values in the matrix form above. Remember to separate the numbers by commas and to start each transform on a new line.
Credits and a note:
Most of the fractals in the list were obtained from Larry Riddle's web page at http://ecademy.agnesscott.edu/~lriddle/ifs/ifs.html
. This page contains much useful information on how fractals are related to iterated function systems and is highly recommended. Also, if anyone discovers an interesting fractal that isn't on the list, e-mail me the transforms at email@example.com
and I'll include them in the list along with a credit for the contributor.
Guy Stallings, June, 2003