Fractal Generation Program

Macintosh Version
Written by Cathy and Tom Saxton
Copyright ©1999. All rights reserved.


Topics:
The Basics -  Calculating Fractals -  Status Bar -  Fractal Statistics Dialog -  Menu Commands -  Keyboard Shortcuts


The Basics

Click to zoom in. Option + Click to zoom out.

Cmd + Click to re-center.

Shift + Click in the Mandelbrot set to show the Julia set corresponding to the clicked coordinate.
Shift + Click in a Julia set to show the Mandelbrot set centered at the coordinate used for that Julia set.

See the View menu for available adjustments.

Calculating Fractals

The Mandelbrot and Julia fractals are drawn in the complex plane (real numbers along the x-axis, imaginary numbers along the y-axis). The value for each coordinate is determined by iterating the function
      z(n+1) = z(n)^2 + C
There are two possible outcomes for the series. The series may diverge, that is grow without bound farther and farther away from the origin. Or, the values in the series may stay near the origin forever. Those points whose series stay near the origin forever are inside the set. Those points whose series diverge are outside the set.

It can be shown that if the magnitude of z(n) is greater than 2, then all successive values will be larger than their predecessors. Thus, we can assign a value for each coordinate equal to the number of iterations it takes that point's series to exceed the magnitude 2 limit. Points whose series exceed the magnitude 2 limit have a finite value and are outside the set. By convention, points inside the set are colored black; points outside the set are colored according to how quickly they escaped the magnitude 2 limit.

Since we don't want to run forever to find the set, we set an iteration limit. Points whose series stay within the magnitude 2 limit up to the iteration limit are colored black. The higher the iteration limit, the more accurately the black pixels represent the actual set.

For the Mandelbrot set, z(0) is always 0. For each coordinate in the Mandelbrot set, the series is computed using that coordinate value as the value for C.

There are an infinite number of Julia sets, one for each point in the complex plane. For the Julia set corresponding to a given complex number, C is set to that number. Then, for each coordinate in that Julia set, z(0) is set to that coordinate value and the series is computed.

The connection between the Mandelbrot set and the many Julia sets, beyond using the same z-series, is that Julia sets that are the most interesting correspond to points just outside the Mandelbrot set (the black part).

For more in-depth information about fractals, see the sci.Fractals FAQ.

Status Bar

The status bar at the bottom of the window shows data for the fractal image. The data in the status bar is also shown in the Fractal Statistics dialog, where it is also possible to change the values.

The contents of the status bar, from left to right, are:

  • Center Point -- the coordinate (in the complex plane) that's in the center of the window.
  • Zoom Factor -- how magnified the image is.
  • Iterations -- the maximum number of iterations used for calculating the set.
  • Color Cycle Size -- the number of iterations per loop around the color wheel; the higher the value, the more gradual the color change.
  • Starting Hue Value -- this represents the starting location in the color spectrum as colors are assigned.

Fractal Statistics Dialog

The Fractal Statistics dialog can be accessed from the Edit/Fractal Stats... menu command or by hitting Cmd+I. It shows the current settings for the fractal parameters and allows those values to be changed.

The controls in the dialog are:

  • Center -- the x and y values for the point (in the complex plane) that's in the center of the window.
  • Iterations -- the maximum number of iterations used for calculating the set.
  • Zoom -- how magnified the image is; affects Unit (pixel) size value.
  • Unit (pixel) size -- the width of a pixel (in complex coordinates); this is modified when Zoom is changed.
  • Color Cycle Size -- the number of iterations per loop around the color wheel; the higher the value, the more gradual the color change.
  • Starting Hue Value -- this represents the starting location in the color spectrum as colors are assigned.
  • Value for C (when a Julia set is displayed) -- this is the value used for C when iterating to find each pixel value; see Calculating Fractals for details.

Use the spin controls to change values for Iterations, Zoom, Color Cycle Size, and Starting Hue Value.

If you exit the dialog using the OK button, the new values will be applied and the fractal will be recalculated. If you exit with the Cancel button, any changes will be lost and the original image will be unchanged.

Menu Commands

File commands

Note: the data files written by Fractal Generation Program can be read by both the Windows and Macintosh versions of the program.

New (Cmd+N) -- creates a new window showing the Mandelbrot fractal with default settings.

Open... (Cmd+O) -- prompts for a file to open; you can specify any data or PICT file written by this program or a data file written by the Windows version.

Close (Cmd+W) -- closes the current window.

Save (Cmd+S) -- saves image information to a data file; the current image can be regenerated in the future by opening that file.

Save As... -- prompts for a new data file for saving parameters for the current image.

Save with PICT... (Cmd+P) -- creates a pict file that can be opened by other applications; also saves the fractal data in the file so it can be read with File/Open.

Quit (Cmd+Q) -- quits the program.

Edit commands

Copy (Cmd+C) -- places a copy of the current image on the clipboard (in bitmap format).

Fractal Stats... (Cmd+I) -- brings up the Fractal Statistics dialog, where you can view and change the values for the fractal image.

View commands

Shift Hue Left (left arrow) -- changes the starting hue value in the color spectrum; this will shift all colors 60 degrees counterclockwise around the color wheel (red goes to magenta, magenta goes to blue, etc).

Shift Hue Right (right arrow) -- changes the starting hue value in the color spectrum; this will shift all colors 60 degrees clockwise around the color wheel (red goes to yellow, yellow goes to green, etc).

Faster Color Change (up arrow) -- adjusts the coloring in the image to have a larger change in color as the iteration value changes; this tends to provides more colors in the image.

Slower Color Change (down arrow) -- adjusts the coloring in the image to have a smaller change in color as the iteration value changes; this tends to provide fewer colors in the image.

More Iterations (>) -- increases the iteration limit; this will provide more detail in areas that are black, but increases calculation time.

Fewer Iterations (<) -- decreases the iteration limit; this will speed up calculations, but provides less detail in the image.

Zoom In (+ or Click) -- enlarges the image and resets the center coordinate to the location clicked.

Zoom Out (- or Option + Click) -- shrinks the image and sets the center coordinate to the location clicked.

Full Screen -- changes the window size and location so that the image exactly fills the screen; this is useful if you want to save an image for a desktop pattern.

Julia Set (Shift + Click) -- displays the Julia set corresponding to the (Mandelbrot) coordinate currently in the center of the screen. (This command only appears on the menu when the current set is the Mandelbrot set.)

Mandelbrot Set (Shift + Click) -- displays the Mandelbrot set centered at the coordinate used for the current Julia set. (This command only appears on the menu when the current set is a Julia set.)

Reset -- resets the center point, zoom, iterations, color change rate, and starting hue to default values for the current set; does not affect the window size or location.

Help commands

Fractal Application -- shows a dialog with version information and basic usage information.

The Mandelbrot Set -- shows a description of the calculations involved in displaying the Mandelbrot set.

The Julia Sets -- shows a description of the calculations involved in displaying the Julia sets.

Keyboard Shortcuts

KeyAction
Cmd+NCreate a new window
Cmd+OOpen a file (data or PICT)
Cmd+WClose the current window
Cmd+SSave a data file
Cmd+PSave a PICT file
Cmd+QQuit the program
Cmd+CCopy current image to clipboard
Cmd+IEdit fractal statistics
KeyAction
left arrowShift hue left
right arrowShift hue right
up arrowFaster color change
down arrowSlower color change
>More iterations
<Fewer iterations
+Zoom in
-Zoom out

Tip: you don't need to use shift for + < or >. Just press the appropriate key.

 
©2000-2024 Idle Loop Software Design, LLC. You may not copy or reproduce any content from this site without our consent.