Mandlebrot set
Doug Gwyn
gwyn at smoke.BRL.MIL
Sun Jul 2 13:09:26 AEST 1989
In article <1354 at uceng.UC.EDU> mfinegan at uceng.UC.EDU (michael k finegan) writes:
> While the calculation of members of the Mandelbrot set may be well known, do
>you have pseudo-code for calculation of members of a Julia set?
There are all sorts of clever schemes, but the following extract from a
program that creates Mandelbrot & Julia convergence displays in the
"obvious" way shows that the calculations are quite similar:
if ( julia )
{
zx = cx;
zy = cy;
for ( k = 0; k < iters; ++k )
{
register double x = zx * zx - zy * zy + jx;
zy = 2.0 * zx * zy + jy;
zx = x;
if ( zx * zx + zy * zy >= thresh )
break;
}
}
else { /* mandelbrot */
zx = zy = 0.0;
for ( k = 0; k < iters; ++k )
{
register double x = zx * zx - zy * zy + cx;
zy = 2.0 * zx * zy + cy;
zx = x;
if ( zx * zx + zy * zy >= thresh )
break;
}
}
More information about the Comp.lang.c
mailing list