## IFS Fractals

Author: Greg Paperin.

### Iterated Function Systems

Iterated Function Systems (IFS) is a widely known class of fractals that are self-similar by construction. The fractals are constructed by creating copies of a geometrical object that are transformed by transformation functions (thus, “function systems”). The results of the transformation are combined with the original image and then transformed again and again (thus, “iterated”). The fractal is the limit object arising as the result of the IFS. Interestingly, the result depends only on the IFS itself and not on the initial object. Thus, when rendering IFS fractals, a point is taken as the initial object for simplicity.

Although different kinds of transformations can be used in IFS, *affine transformations* are used most commonly. An affine transformation of a point (*x*, *y*) to the point (*x _{n+1}*,

*y*) can be described as

_{n+1}*x _{n+1} = a·x_{n} + b·y_{n} + e*

*y*

_{n+1}= c·x_{n}+ d·y_{n}+ fThus, a transformation can be described as a 6-tuple *(a, b, c, d, e, f)*. An IFS is then a collection of *r* transformations where *r* >= 2:

*T _{1}: (a_{1}, b_{1}, c_{1}, d_{1}, e_{1}, f_{1}, P_{1})*

*T*

_{2}: (a_{2}, b_{2}, c_{2}, d_{2}, e_{2}, f_{2}, P_{2})…

*T*

_{r}: (a_{r}, b_{r}, c_{r}, d_{r}, e_{r}, f_{r}, P_{r})Note the additional parameter *P _{i}* for each transformation. This is the transformation probability. When the IFS is executed, it normally begins with a random point

*p*in the plain. A transformation

_{0}*T*is then randomly chosen with the probability

_{n}*P*. The resulting point

_{n}*p*is calculated and rendered. Then the next transformation is chosen randomly with a probability specified by the transformation parameters. The next point is obtained using this transformation and rendered. This process is then continued

_{1}= T_{n}(p_{0})*ad infinitum*(for an ideal fractal) or until the required saturation is reached (for a rendering approximation).

### How to use the renderer

You need Java version 1.6 or later in order to run the renderer.

A number of well known IFS fractals are built into the renderer. Barnsleyâ€™s fern may be the most famous of the IFS family, but some other very famous fractals, such the Sierpinski triangle can also be obtained using this method.

**Preset**: Choose a predefined fractal from the preset list. The transformation table will be immediately populated with the corresponding values (warning: all previous values will be discarded). You need to hit the*Apply*button to apply the IFS specified in the table to the rendering engine.**Transformation table**: In this table you can specify the affine transformations for the IFS. You can edit any of the transformation parameters at will. Only enabled transformations are actually used. Note that the*P*-values of all enabled transformations must sum up to 1.0.**Multi-colour**: When disabled, all points are rendered using the same colour. When enabled, the colour of a point depends on the transformation that was used to obtain that point.**Apply**: Hit this button in order to (re-)initialise the rendering engine with the IFS specified in the transformation table.**Start**: Hit this button to begin rendering the IFS.**Stop**: Hit this button to stop the rendering process.**Clear**: Hit this button to clear the canvas.**About**: Hit this button to display the developer credits.

### Things to try

- Check out the fractal summary page and the fractals and scale tutorial to gain a better understanding of the theory behind this fractal image renderer.
- Play around with the predefined IFSs.
- Learn about how different geometric operations such as rotation, scaling, movement and others that can be represented using matrices (the
*Wikipedia*article on transformation matrices [http://en.wikipedia.org/wiki/Transformation_matrix] and other links below may be helpful).

Using the multi-colour function, try to understand how the predefined IFS work. - Try to modify the predefined IFS to obtain new but similar images.
- Try creating your own new IFS fractal.

### Download source code

You can download the Java source code for the renderer as a ZIP archive (50 KByte).

### Links and references

*Wikipedia*article “Iterated function system”:

http://en.wikipedia.org/wiki/Iterated_function_system*Wikipedia*article “Affine transformation”:

http://en.wikipedia.org/wiki/Affine_transformation- Weisstein, Eric W. “Affine Transformation”. From
*MathWorld – A Wolfram Web Resource*:

http://mathworld.wolfram.com/AffineTransformation.html *Wikipedia*article “Transformation matrix”:

http://en.wikipedia.org/wiki/Transformation_matrix