Mandelbrot Fractal Generator


To Zoom : Click once, move mouse to frame desired location, then click again.

Click back on you browser to get back to the newspeak dictionary.


Mandelbrot Fractal Generator

      What does this page have to do with George Orwell?... ABSOLUTELY NOTHING!

      This java Applet creates fractal images using the Mandelbrot set. A fractal is a pattern that become more complex as it is enlarged, as opposed to regular patterns which generally tend to smooth-out and become simpler when magnified.

      Fractals were discovered by Benoit Mandelbrot, a programmer for IBM. In his book, The Fractal Geometry of Nature, Mandelbrot stated that all shapes in nature could be created using fractal math.

      Throughout the book showed examples of fractal geometry in nature (hence, the title). He discussed clouds, crystals, mountain ranges, and the like ... but his primary interest was in measuring coastlines -- Mandelbrot was obsessed with coastlines. The length that is assigned to a coastline, he said, all depended on how detailed the survey was. For example ... When measuring the Eastern coastline of the U.S., one could simply draw a straight line from the top of Maine down to the bottom tip of Florida and obtain a result of about 1600 miles ... or you could follow the rough contour of the shore on a map and obtain a result of about 2000 miles ... or you could actually use large tape measure and walk up the coast, (measuring around every nook & cranny), and obtain a result of 5000 miles ... or you could use an electron microscope and ... well, you get the picture. The idea is that you cannot measure these type of things using standard geometry.

      You can never actually measure their perimeter because they just keep getting more complex the closer you scrutinize them. All fractals behave this way. The closer you look at them, the closer the length of their perimeter approaches infinity. Mandelbrot expressed these infinite lengths as fractional dimensions... but at this point I lost interest in Mandelbrot and his theories because I was only interested in how to draw the dern' things!

      Fractals are really nothing more than three-dimensional graphs, with the 3rd dimension represented by color. They are created buy plugging x & y values into formula and then looping that formula so that the output from one pass is used to feed the next. You then count how many times it takes for the output to become greater than a specified value, or to loop a maximum number of times. You then take these results, and draw the graph.

The actual equation is as follows:

RealNumber = x * x
ImaginaryNumber = y * y;
y = 2 * (x * y) + originalY
x = RealNumber - ImaginaryNumber + originalX

      After each pass through the formula, the program checks to see if RealNumber + ImaginaryNumber is greater than 1,000,000. If it is, or if the program has looped more than 42 times, the program exits the loop, and makes note of how many loops were necessary to reach that value. the program then continues through all of the x & y values in the graph, and calculates a value for each of them. When it is finished, you end up with an array of values from 1 to 42. Each one of these values is assigned a color, and the graph is then drawn on the screen.

      If this were a true 3-d graph, it would look like a mountain with its peak at the origin. Actually, it would look like a huge plateau because the formula is set to stop calculating once a specific number of loops has been reached, which "tops off" the mountain, and creates a large flat area on top. The program simply cannot solve for all of points in the graph, because points located near the origin would take a very, VERY long time to finish calculating. If fact, the origin itself is an infinite loop, which by definition, would take infinity to calculate. (Try plugging x=0 and y=0 into the formula and you will see that the values never change.)

      When using this program, please bear in mind that it was the first program I had ever written in Java, and is therefore a little quirky. The procedure that you must use to zoom in on an area is a little odd and the features on the menu aren't very well designed, but it still a pretty cool program. One day I may go back and correct my mistakes, but right now I have better things to do.

I'll give you a brief explanation of the buttons and boxes at the top of the screen.
  1. Previous Image
  2. Next image
  3. REDO - Redraws image using new parameters
  4. Staring X value.
  5. Width of X
  6. Starting Y Value
  7. Height of Y (a negative value. This may seem odd, but it made sense at the time I was writing the program)
  8. Max Loops. This is how many times the program will loop on each point. More loops mean more processing time, but give you more detail. The default is 42, which gives you 42 different colors. Increasing that number will give you more steps of color, and hence will allow you to see more detail
  9. C+ - Allows you to switch between my pre-set color schemes
  10. R - Creates a groovy random color scheme



ENJOY!







Home