Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: √ ∞ ≠ ≤ ≥ ≈ ⇒ ∈ Δ θ ∴ ∑ ∫ π -

Login

Username

Password

Not registered yet?

#1 2007-10-18 09:32:46

bossk171
Power Member

Offline

The Mandelbrot Set and Julia Sets

Does anyone know the difference?

I almost put this in the Help Me section, then I thought about the code section, but I thought that this might be appropriate here. I understand how they are created, this wiki was particularly helpful (specifically the code part) but I can't figure out the defferance between the Mandelbrot Sets and the Julia Sets. And because there's no code part on the Julia Stes page I can't even take a guess. The process looks the same in both cases for me.

Unfortunately the formal definitions are simply too technical for me.


There are 10 types of people in the world, those who understand binary, those who don't, and those who can use induction.
 

#2 2007-10-18 17:05:41

luca-deltodesco
Super Member
Award: Wink Alive

Offline

Re: The Mandelbrot Set and Julia Sets

both sets use the same equation:



in a manelbrot set, z0 = 0, and c is the point in the complex plane you are graphing
in a julia set z0 is the point in the complex plane you are graphing, and c is some constant chosen for the whole fractal which gives you the different julia sets.

code wise they are almost exactly the same aswell, for a mandelbrot you might have

(modsqr(z) = z.r^2 + z.i^2)

Code:

bool isInMandelbrot(Complex c) {
  Complex z;
  for(int i = 0; i<MAX_ITERATIONS; i++) {
     z = z*z+c;
     if(z.modsqr()>4.0) {
       return false;
     }
  }
  return true;
}

and for julia:

Code:

Complex c (0.125,-0.8); //random chosen constant
bool isInJulia(Complex z) {
  for(int i = 0; i<MAX_ITERATIONS; i++) {
     z = z*z+c;
     if(z.modsqr()>4.0) {
       return false;
     }
  }
  return true;
}

Last edited by luca-deltodesco (2007-10-18 17:11:56)


The Beginning Of All Things To End.
The End Of All Things To Come.
 

#3 2007-10-19 01:04:46

bossk171
Power Member

Offline

Re: The Mandelbrot Set and Julia Sets

So then there can be only one Mandelbrot Set, but there are an infinity of Julia sets, is that right?

Thanks for the code by the way, that really clears things up.

Last edited by bossk171 (2007-10-25 05:34:48)


There are 10 types of people in the world, those who understand binary, those who don't, and those who can use induction.
 

Board footer

Powered by FluxBB