Contents

Mandelbrot & Julia Fractals
Mandelbrot & Julia Set Generator
Here is a simple Java applet to help you generate your own Mandelbrot and Julia sets:

Instructions
Click “Generate Image” to view the fractal. You can click on the picture to recenter it or you can manually enter the central coordinates (x0, y0). Then you can zoom in by increasing the dpi. The max iterations has been set for optimal results when you are zoomed out. You will need to increase it if you zoom in a lot.
As an added feature, I have included an option for changing the power of the base equation. For example, power = 3 uses the equation z_{n+1} = z_{n}^{3}+z_{c} instead of the conventional equation z_{n+1} = z_{n}^{2}+z_{c}. You can use this feature to generate my favorite Julia Set by setting the method to "Julia Set" and setting xc = 0.5, yc = 0.05, power = 3.0.
Click here to view the source code.

How The Mandelbrot Set Works
The Mandelbrot Set is found by iterating the equation z_{n+1} = z_{n}^{2}+z_{c} where z_{0} = 0. The number z is a complex number. We define the Mandelbrot Set to be the set of all complex numbers z_{c} such that z_{n} is finite as n goes to infinity.
There is a theorem which states that it will not be finite if the magnitude of z_{n} ever exceeds 2.
In order to generate an image, we must iterate this equation repeatedly for every value of z_{c} in the complex plane.
For example, let's say we want to color a pixel at (1,0.5). We start out with z_{c} = 1+0.5i and z_{0} = 0 and proceed from there:
z_{1} = z_{0}^{2}+z_{c} = 1+0.5i
z_{2} = z_{1}^{2}+z_{c} = 0.250.5i
z_{3} = z_{2}^{2}+z_{c} = 1.1875+0.75i
z_{4} = z_{3}^{2}+z_{c} = 0.15293441.28125i
z_{5} = z_{4}^{2}+z_{c} = 2.61839+0.890381i
We stop here because the magnitude z_{5} = 2.76564 > 2. We conclude that this point is unbounded and color code our pixel based on the required number of iterations n = 5. Then we repeat the whole process again for each pixel.

How The Julia Set Works
The Julia Set is very similar to the Mandelbrot Set. However, instead of plotting pixels for different values of z_{c}, we assume z_{c} is a given constant for all the pixels and we plot different values of z_{0}. Therefore, there are infinite Julia Sets depending on what value you choose for z_{c}.
For example, let's say we want to color a pixel at (1,0.5) for the Julia Set using the constant z_{c} = 1.125+0.25i. We start out with z_{0} = 1+0.5i:
z_{1} = z_{0}^{2}+z_{c} = 0.3750.75i
z_{2} = z_{1}^{2}+z_{c} = 1.546880.8125i
z_{3} = z_{2}^{2}+z_{c} = 0.60767+2.26367i
We stop here because the magnitude z_{3} = 2.34381 > 2. We conclude that this point is unbounded and color code our pixel based on n = 3.

