Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Mandlebrot set Keywords: fractal, mandelbrot, julia, graphics Message-ID: <10479@smoke.BRL.MIL> Date: 2 Jul 89 03:09:26 GMT References: <2492@blake.acs.washington.edu> <225800193@uxe.cso.uiuc.edu> <1354@uceng.UC.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 36 In article <1354@uceng.UC.EDU> mfinegan@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; } }