Here is a Java applet which computes views of the Mandelbrot set and Julia sets. It lets you zoom in to examine a section of a set more closely by selecting a point to magnify around. There is also a color editor so you can recover any image to show it off to its best advantage. Full instructions for use are further down the page. There is also an explanation of why I bothered to write this when there are so many Java Mandelbrot generators already. To learn more about generating Mandelbrot and Julia sets, you can read the Fractal FAQ.
The Mandelbrot applet has three panels, one each for the Mandelbrot set, Julia sets, and coloring. Each panel has two sides -- on the left is the active image, and on the right is a helper image or control panel. In addition, the set displayers have some navigation controls.
The left half of the Mandelbrot panel starts with an image of the whole set. By clicking in this image, you can zoom in by a factor of two; where you click will be the center of the new image, which will take the place of the old image on the left half of the panel. The old image will move to the right side and will display an outline which surrounds the area covered by the new image. You can also click on the right hand image to generate a new image on the left. This is good if you need to reposition to capture a feature you accidentally cut off when you magnified.
Under each image is some information about where it is in the set. The center point of the image is first, displayed as a complex number <a, bi>. The magnification factor is second -- this represents the ratio of the sides of the current image to the whole set. The sides of the first image are 3 units long, so the sides of all the other images are 3/mag units.
At the bottom of the panel are three navigation controls. The << and >> buttons allow you scroll through the stack of images you have generated, so you can see where you have been. At any point you can go back to a previous image and use that as a basis for new exploration. One caveat: whenever you use an image in the middle of the stack to generate a new image, all images to the left of it (ones with greater magnification) will be lost. The reset button brings you back to the starting image and discards all the images in the stack.
There is one Julia set for every complex number. The Mandelbrot set is the result of an attempt to find a way to catalog Julia sets -- points near the boundary of the Mandelbrot set generate interesting Julia sets! (I find Julia sets generated from the region around the "coccyx" on the Mandelbrot set's right side the most interesting.) The Julia set panel starts with the most recent Mandelbrot image on the right, and the Julia set which corresponds to the middle of that image on the left. You can click in the Mandelbrot image to select a point to generate a new Julia set from. Once you find a set you like, you can explore it the same way you would explore the Mandelbrot set, by clicking on the left image to magnify it.
Under each Julia image is the same information as for a Mandelbrot image. I should really add which complex point is being used to generate the set, but I can't find a convenient place to display that. If you have an idea, please mail it to me.
The navigation controls work the same way as the Mandelbrot controls.
If you want to highlight some special part of an image, or if you just get bored with black-and-white, you can change the colors of the active image with the color editor. Julia and Mandelbrot sets are made by iterating a simple function. For points in the set, the iteration always remains finite; these points are colored black. For points outside the set, the iteration eventually diverges to infinity -- the speed at which the divergence happens is used to color the image.
When you select a new color scheme, it is applied to the active image and all images generated subsequently. Prior images are not effected.
I'm doing a simple interpolation between two base colors to determine which colors to use. You can select the base colors using the color wheels which are on the top right of the color panel. The hue of the color changes around the wheel; the saturation changes radially. The bar under the wheel is used to change brightness.
You can interpolate colors in RGB or HSB space. RGB is more familiar to people, so it is the default; however, I tend to prefer images generated with HSB interpolation.
Colors are interpolated from the first to the second in a number of steps, the more steps the smoother the transition. Most monitors can't display subtle differences between colors, so choosing a step count which is too large will blur the image. I find that 16 is a good step count for grayscale images, but a higher one works well when using color. If you want an image consisting only of the two colors you have chosen, alternating, choose a step of 1.
The color editor is rather cumbersome and doesn't always produce intuitive results. If you have suggestions for improving it, write me.
Mostly, it's an ego trip. I thought it would be fun to write, so I did. But I also looked at all of the Mandelbrot set generators I could find on the net, and I think this one has some advantages:
In the future I hope to add a couple more features:
Copyright © 1997 Andrew MacDonald, All
Rights Reserved
Last updated: September 23, 1997