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;