문제

I wrote a mandelbrot set and I have read about the julia set that it's very similar but what is the relationship exactly? Can I use the mandelbrot formula to draw a julia set? What is the starting parameter? Read my code for a mandelbrot set:

     function complex_iterate($re,$im)
     {
           $re=strval($re);
           $im=strval($im);
           $zisqr = $zrsqr = $iter = $zIm = $zRe = "0";
           bcscale(50);

           while (floatval(bcadd($zrsqr,$zisqr)) < 4
               && $iter < $this->iterations
           )
           {
                 $zIm = bcmul($zIm,$zRe);
                 $zIm = bcadd($zIm,$zIm);
                 $zIm = bcadd($zIm,$im);
                 $zRe = bcadd(bcsub($zrsqr,$zisqr),$re);
                 $zrsqr = bcmul($zRe,$zRe);
                 $zisqr = bcmul($zIm,$zIm);
                 ++$iter;
            }
            return $iter;

I'm not sure what it means mandelbrot set is iterate for z and julia set is iterate for c? Do I need to change the code at all?

Update: I changed my code but it doesn't work. My idea is to start with $re and $im instead of 0:

    $zisqr = $zrsqr = $iter = 0;
    $zIm=$im;
    $zRe=$re;
    $re="-0.7";
    $im="0.27015";

Update 2: I forgot this:

    $zrsqr = $zRe*$zRe;
    $zisqr = $zIm*$zIm;
도움이 되었습니까?

해결책

As I see you are new to Mandelbrot and Julia here are some definitions to see the relationship.

  • Mandelbrot map: the map you calculate and visualize graphically
  • Mandelbrot set: those points on the map that go to infinity (which you usually paint black. Those shiny colored parts on the usually displayed Mandelbrot pictures are not part of the Mandelbrot set)
  • Continous map: where points on the set lies next to each other (you can walk the whole map by starting from any point)
  • Island map: where points on the set lie isolated (you cannot walk the whole map from a starting point)

There is only one Mandelbrot set and there are infinite Julia sets and some definition says the Mandelbrot set is the index set of all Julia sets.

In other words: you can calculate a Julia set from any point within a certain limit (if you take large values the result might be empty, though). If your chosen point is not part of the Mandelbrot set (it is not a black pixel when visualized), the resulting Julia set will contain islands. However if you choose a point that is part of the Mandelbrot set (it is a black pixel when visualized) the resulting Julia set will be contiguous.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top