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.
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.