Fractals are functions such that whenever you look deeper into a section of the curve you see repetitions and self-similarities to what you first started with. Fractals are recursive and iterative and chaotic. They are mathematical functions that are differential nowhere For those of us who have forgotten our mathematics, read on. A continuous function is a function that is defined everywhere. It has no breaks in it. If we now look at how this continuous function changes in value, then this is called the derivative of the function. A smoothly changing function usually has a nice derivative. But, if our continuous function has nasty sharp points in it then the derivative might become infinite. This would be a point where the function is not differentiable. Now, think of a function where every point is nasty. If you can come up with one of these functions then you have perhaps discovered a fractal function. Fractal functions can be thought of as broken or fractured everywhere. Truly chaotic..
Benoit Mandelbrot was a mathematician who in 1979 discovered the Mandelbrot set of points. Images of the Mandelbrot set display an elaborate boundary that show ever-finer recursive detail at increasing magnifications. This set has a boundary that is a two dimensional fractal shape. Mandelbrot gave us a simple iterative way to calculate the points. The set is calculated as:
Each point in the set is a complex number A complex number is a number that has both a real part and an imaginary part. It is put in the form a + bi, where a is the real part and bi is the imaginary part. Complex numbers extend the idea of real numbers into the complex plane. The real part is the horizontal axis and the imaginary part is the vertical axis. A complex number a + bi can be represented as the point (a,b) in the plane.. We can make an image of the Mandelbrot set by thinking of pixels on our computer screen as points in the complex plane. To generate a Mandelbrot image we evaluate each point or pixel by iterating for a maximum number of times. Each time we iterate we test the point to see if it is in the Mandelbrot set. A point is inside the set if its distance from the origin is less than 2. If it falls out of the set or escapes from the set then it is given a color that relates to the number of iterations it took to escape. Otherwise, If the point is still in the set at the maximum number of iterations then it is usually colored black.
The Julia set is related to the Mandelbrot set. It uses the same formula as above, but rather than always starting Z from zero as c ranges over the plane, we fix some c and let the initial Z range over the plane. Julia sets are centrally symmetric.
A very nice Julia set that looks a bit like a dragon can be seen at c = -0.2 – 0.7i.
Another Julia set that looks like a fractal rabbit (Douady’s rabbit) is at c = -0.12 + 0.75i.
A Julia set with some wonderful colors can be found at c = -0.75 + 0.015i.
I have developed a Java application to generate and display these fractal images based on earlier work by Evgeny Demidov. My Java application shown below can be launched to show the Julia sets at various places on the complex plane. This application will automatically traverse the boundary of the Mandelbrot set. Click anywhere in the Julia set or the Mandelbrot set to stop the animation. When stopped, click on any point in the Mandelbrot set to see the related Julia set. An
<alt>-click will zoom in to either the Mandelbrot set or the Julia set to see fractal repetition. A
<ctrl>-click zooms out. The Mandelbrot and Julia set images can each be saved.
Errata: March 1, 2013.
Java Plugin 7 update 15 and lower introduces a security risk for Java applets and applications run in your web browser. This fractal application does not require the plugin. You can securely run this application if Java content is enabled in the Java Control Panel on your system.
The default colors of the Mandelbrot set and Julia sets shows how quickly points in the complex plane escaped from the set. Red colors represent points that escaped quickly and blue or violet colors represent points that took many iterations before the value became too large. The default colors are known as the Rainbow coloring scheme.
However, coloring is subjective. Other color styles can be applied to the escaping iteration counts to produce many different images. The example below shows a blue and white coloring scheme. The fractal images now look more like snowflakes.
Using standard iteration counts for colors produces discrete values that can result in color bands in the image. The boundaries between the colors can be smoothed by using different algorithms that frequently generate continuous color values. One common method is to measure the distance of the point from the origin when it escapes from the set. I have used a distance estimating method in the image shown below.
Other methods measure the angle of escape or the velocity of escape. For example, the polar coordinate angle can be computed as follows:
This will yield a value in the range 0-N. The number N determines how many segments the circle of possible angle values is divided into, i.e. if N is 2, the image will be colored according to whether the imaginary part of Zn is positive or negative. With a nicely shaded colormap, a larger N up to 250 gives beautiful pictures.
It should be noted that the Mandelbrot equation Zn+1 = Zn2 + c is not the only equation that can be used to generate fractals. The example below shows the Mandelbrot set for the equation Zn+1 = Zn4 + c.
Boundary Tracing Algorithm
One difficulty when displaying fractals is the computation time necessary for the number of pixels that need to be calculated. The fast performance of this solution is primarily due to the Boundary Tracing algorithm by Michael Ganss.
In the left image below only 13% of pixels are calculated and all the rest are simply flooded. But it is evident that you can get wrong picture (to the right) for very large scale. This can be corrected by zooming into the image by clicking on it.
A further release of this program would likely contain additional features to generate three dimensional fractal images. The magnification interface could be improved to allow for user selected areas. Zoom and positioning parameters could be provided. If you are interested in this then please send a note.
Download and Installation
The source code for this application can be downloaded here. To install the application for local execution, download and unpack the zip file. Inside the zip file you will find another distribution zip file ‘dist.zip’. Unpack this zip file, too. Inside the unpacked distribution folder in this zip file you will find the ‘Julia.jar’ file. This is the Java application.
To run the project from the command line, go to the dist folder and type the following:
java -jar "Julia.jar"
2. Evgeny Demidov http://www.people.nnov.ru/fractal/MSet/Contents.htm
3. Michael Ganss http://www.ibiblio.org/e-notes/MSet/TheAlmondBreadHomepage.htm
4. Francisco Garcia, Angel Fernandez, Javier Barrallo, Luis Martin Coloring Dynamical Systems in the Complex Plane
5. David Leberknight http://www.softwarefederation.com/fractal.html