How is the Mandelbrot set plotted and how are the color values determined?

In summary, the image on wikipedia is a picture of a complex plane with white and black points plotted according to how often the calculation for the point (x,y) goes over 2 in real or imaginary. A Mandelbrot set program needs a few essential pieces, like a loop of instructions for applying the arithmetical rule to a complex number, and a way to keep track of the running total. If the running total heads off to infinity, the point does not belong to the set, and the program can move on. If the running total repeats many times without becoming greater than 2, the point is in the set.
  • #1
rohanprabhu
414
2
I found this image on wikipedia: http://en.wikipedia.org/wiki/Image:Mandel_zoom_00_mandelbrot_set.jpg

and i have seen this image like many times, but i have never understood as to how it is plotted. How is the value of the color decided? Plus, if it is a complex plane, how are the axes defined? I remember reading that if a point lies in the complex set which is being plotted, it is given the color white, otherwise it is plotted as black [or vice versa, not sure]. Either ways, how are the other color values decided?
 
Physics news on Phys.org
  • #2
I made a little java program that generates pictures like that one so I could make them for my desktop. The source code is bundled with it. Here is the link:

http://dl.getdropbox.com/u/120094/Chaos%20Program%20and%20Source.jar
 
Last edited by a moderator:
  • #3
You interpret each point on the plane (your monitor screen) as a point (x,y) in the complex plane: x+ iy. The Mandelbrot set is defined as the set of points (x,y) such that the sequence z0= 0, zm+1= z2+ x+ iy. You run that iteration long enough to see if it converges or not (if |zn|> 2, it diverges). Color the point (x,y) black if it converges, white if not. Most "Mandelbrot" set pictures look at how many iterations it take to make |zn|> 2 and color according to that. Those points are NOT in the Mandelbrot set but close to it and it makes a prettier picture!
 
  • #4
the longer it takes for a point to diverge the brighter it's colored
 
  • #5
A Mandelbrot set program needs just a few essential pieces. The main engine is a loop of instructions that takes its starting complex number and applies the arithmetical rule to it. For the Mandelbrot set, the rule is this: zz2+ c, where z begins at zero and c is the complex number corresponding to the point being tested. So, take 0, multiply it by itself, and add the starting number; take the result—the starting number—multiply it by itself, and add the starting number; take the new result, multiply it by itself, and add the starting number. Arithmetic with complex numbers is straightforward. A complex number is written with two parts: for example, 2 + 3i (the address for the point at 2 east and 3 north on the complex plane). To add a pair of complex numbers, you just add the real parts to get a new real part and the imaginary parts to get a new imaginary part: 2 + 4i
+ 9 – 2i
11 + 2i
To multiply two complex numbers, you multiply each part of one number by each part of the other and add the four results together. Because i multiplied by itself equals –1, by the original definition of imaginary numbers, one term of the result collapses into another. 2 + 3i
 2 + 3i
6i + 9i2
4 + 6i
4 + 12i + 9i2
= 4 + 12i – 9
= – 5 + 12i
To break out of this loop, the program needs to watch the running total. If the total heads off to infinity, moving farther and farther from the center of the plane, the original point does not belong to the set, and if the running total becomes greater than 2 or smaller than –2 in either its real or imaginary part, it is surely heading off to infinity—the program can move on. But if the program repeats the calculation many times without becoming greater than 2, then the point is part of the set. How many times depends on the amount of magnification. For the scales accessible to a personal computer, 100 or 200 is often plenty, and 1000 is safe.

The program must repeat this process for each of thousands of points on a grid, with a scale that can be adjusted for greater magnification. And the program must display its result. Points in the set can be coloured black, other points white. Or for a more vividly appealing picture, the white points can be replaced by coloured gradations. If the iteration breaks off after ten repetitions, for example, a program might plot a red dot; for twenty repetitions an orange dot; for forty repetitions a yellow dot, and so on. The choice of colours and cutoff points can be adjusted to suit the programmer’s taste. The colours reveal the contours of the terrain just outside the set proper.
 

Related to How is the Mandelbrot set plotted and how are the color values determined?

What is the Mandelbrot set?

The Mandelbrot set is a famous mathematical set that is defined by a simple equation and visualized through a complex and beautiful fractal pattern.

What equation is used to plot the Mandelbrot set?

The equation used to plot the Mandelbrot set is z = z^2 + c, where z and c are complex numbers.

How is the Mandelbrot set visualized?

The Mandelbrot set is visualized by assigning a color to each point in the complex plane, based on how quickly the corresponding sequence of numbers diverges or converges.

What is the significance of the Mandelbrot set?

The Mandelbrot set is significant because it exhibits infinite complexity and self-similarity, making it a fascinating subject for mathematicians and artists alike. It has also led to advancements in the study of complex dynamics and chaos theory.

How is the Mandelbrot set used in the real world?

The Mandelbrot set is used in various fields such as computer science, physics, and engineering. It has applications in image compression, data encryption, and creating realistic landscapes in video games. It also has implications in understanding natural phenomena such as turbulence and heart rhythms.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
303
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Classical Physics
Replies
1
Views
949
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
3K
Replies
1
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top