IFS Mode

The Design window shows the effects of the transformations on an initial polygon. You can translate, scale, rotate, stretch, or shear transformations using the mouse, keyboard, the toolbar at the bottom of the window, or through a dialog box. This provides a way to define or modify transformations without having to enter the numbers in the IFS window.

The initial polygon

You can choose an initial polygon from a pre-defined list. The default selection is an oriented box containing an "L".

Other choices are an oriented equilateral triangle, a unit line or a regular polygon with the number of sides from 3 (equilateral triangle) to 9 (nonagon).

You may also load an initial polygon from a text file with extension ".gon". The file should consist of a list of points, one pair of coordinates to a line. If the polygon is to end at the same point where it started, that point should be listed twice, once at the beginning and once at the end.

A third option is to draw you own initial polygon. Choose Design Initial Polygon from the Design menu. Click in the Design window at the location of the first point. Each subsequent click of the mouse will plot a new vertex of the polygon. If the grid is displayed, holding down the shift key when you click will snap the vertex to the nearest corner of the grid. The cursor will change to a crosshair when the mouse is close to the initial vertex. A click in that case will use the initial vertex. Pressing "D" will delete the last vertex if you change your mind. Pressing "L" while you are drawing the polygon allows you to "lift" the pen so that you can start a new polygon with the next click. Press "Q" after you have chosen the last vertex, or double click the mouse when you are done.

If the initial polygon consists of disconnected parts because the pen was "lifted" during the construction, and the polygon is saved to a file, then a point with coordinates (1000,1000) will be written to the file to separate the vertex where one polygonal piece ends from the first vertex of the next piece.

Here is the file for the oriented box:

 0 , 0 
 1 , 0 
 1 , 1 
 0 , 1 
 0 , 0 
 1000 , 1000 
 0.1 , 0.9 
 0.1 , 0.1 
 0.5 , 0.1 

You can show the initial polygon in the Design window if that item is checked in the Design menu. You can also show the axes or the fixed points for each transformation by checking those items in the Design menu.

There are four ways to adjust the view in the Design window. Choose Scale to Fit to have the program select a window that shows all the polygon images. Choose Scale to Fractal Window to make the scale the same in both the Design and Fractal windows. Choose Zoom Out to zoom out by a factor of 5%. Finally, you can set your own scale for the Design window by entering the coordinates for the corners in the IFS window. You can also shift the Design window up, down, left, or right by using the arrow keys on the keyboard.

Working in the Design Window

Click on one of the polygon images to select it. You can also press one of the number keys to select the image that corresponds to that number. Use "0" for function 10. Use the shift key for numbers larger than 10, so shift-1 is used for 11, shift-2 is used for 12, up to shift-0 for 20.

A selected image will be surrounded by 8 small squares along the boundary of a rectangle containing the image. When an image is selected, you can move, scale, rotate, stretch, shear, or reflect it across a line. The mouse icon will change as you move it over the squares or polygon sides to indicate what can be done. Rotation and shear are selected by also holding down the ctrl key.

Move
Hold down the mouse button on the boundary of the polygon image. Move it to a new position. The textbox in the lower left will show the values of Δx and Δy by which the image has been moved. The IFS window will reflect the new values for the translation vector.

For more precise movement, hold down the shift key and press one of the arrow keys on the keyboard to move the image in a horizontal or vertical direction.

Scale/Stretch
Hold down the mouse button on one of the 8 small squares. The cursor will change to indicate the directions in which the image can be scaled or stretched by moving the mouse. The textbox in the lower left will show the scaling factor in each direction, and the IFS window will reflect the new values as you move the mouse. Holding down the shift key when selecting one of the corners of the design rectangle will restrict the scaling to be the same in both directions. You can also select either Scale or Stretch/Shear from the Design menu to enter the percentage value in a dialog box.

Rotate
Hold down the ctrl key before clicking one of the four corner squares. Move the mouse to rotate the image around the middle of the bounding rectangle. The text box along the lower left edge of the window will indicate the angle of rotation.

You can also rotate the polygon in increments of 0.5 degrees using the keyboard. With the polygon selected, hold down the ctrl key and press the up arrow to rotate in a counterclockwise direction, or the down arrow to rotate in a clockwise direction.

A third way to quickly rotate a selected polygon is to use the toolbar buttons. Click on to rotate counterclockwise by 90° and to rotate clockwise by 90°. Click on the arrow next to each button to get a dropdown menu from which you can choose rotation angles of 30°, 45°, 60°, 90°, 120°, or 180°, or choose "other..." to bring up a dialog box in which you can specify the rotation angle. You can also get this dialog box by choosing Rotate from the Design menu or pressing ctrl-R on the keyboard.

Rotations are done around the center of the bounding box, except when the initial polygon is an equilateral triangle in which case the rotation is done around the centroid of the triangle.

Shear
Hold down the ctrl key before clicking one of the four middle squares along each side of the bounding rectangle. The cursor will change to indicate the direction of the shear. The text box along the lower left edge of the window will indicate the angle of the shear.

You can shear in increments of 0.5 degrees using the keyboard. With the polygon selected, hold down the alt key and press one of the four arrow keys to shear in the direction of the arrow.You can also shear an image by selecting Stretch/Shear from the Design menu.

Reflection
With the polygon selected, choose Horizontal Reflection from the Design menu or click on the toolbar button to reflect the x-coordinates across the vertical line through the center of the bounding rectangle. Choose Vertical Reflection or click on the toolbar button to reflect the y-coordinates across the horizontal line through the center of the bounding rectangle.

While a polygon is selected, choose Duplicate Transformation or click on to make a copy of the matrix parameters for the transformation corresponding to that polygon. A random translation vector will be chosen for the transformation. While the new polygon is still selected you can move it to an appropriate location.

You can also clear a selected transformation while its polygon is selected using the menu, keyboard, or the button . This will remove the transformation from the IFS window.

The Collage Theorem

The Collage Theorem refers to the inverse problem of finding an iterated function system to approximate a given image. You can experiment with this idea by loading an image into the Design window. You can also paste the image from the clipboard. Draw a polygon around the boundary of the image, then create and manipulate transformations to cover the image with reduced copies of itself. Choose Clear Picture to clear the image from the window.