Re: Mandelbrot
- To: mathgroup at smc.vnet.net
- Subject: [mg13602] Re: [mg13595] Mandelbrot
- From: "Jens-Peer Kuska" <kuska at linmpi.mpg.de>
- Date: Fri, 7 Aug 1998 03:08:06 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Hi Jon, at first I recommend to calculate a matrix with the iterations and than try to make List*Plot's of them. Since the Mandelbrot, Julia set is defined by the z[i+1]=z[i]^2+c You will not find an easier way. You have several ways to setup the iteration one possibility is MandelIter[c_Complex,bound_?NumericQ]:= Module[{iter=1}, Catch[ Nest[ If[Abs[#]<bound, iter++;#^2+c , Throw[iter] ] &, c, 256 ] ]; iter ] Since the calculation is a pure numerical task You may use a MathLink program. Tom Wickham-Jones book comes with a Mandelbrot calculation in a MathLink program. The main advantage is the speed gain. There exist more complicated algorithms (You search for easier) with higher speed. Look at "The Science of Fractal Images" by Saupe and Peitgen, Springer-Verlag, 1989 Hope that helps Jens -----Original Message----- From: Jon Prudhomme <prudhomj at elwha.evergreen.edu> To: mathgroup at smc.vnet.net Subject: [mg13602] [mg13595] Mandelbrot > > Hello > > I was just curious if anyone had found a decent way to plot the >Mandelbrot or Julia sets with Mathematica yet. I have been able to do >it with DensityPlot and ListDensityPlot, but I can't help but wonder if >there is an easier way than either of these: > > >iterations=200; >pointColor[c_]:=Module[{i,p}, > For[i=1;p=0,i<=iterations&&Sqrt[Re[p]^2+Im[p]^2]<=2,i++,p=p^2+c];i] > >DensityPlot[pointColor[Complex[x,y]],{x,-2.5,1.5},{y,-1.5,1.5},Mesh->False, > > ColorFunction->Hue,AspectRatio->Automatic,PlotPoints->1000] > >(* or this for a ListDensityPlot... *) > >manSet=Table[pointColor[Complex[x,y]],{y,-1.5,1.5,.01},{x,-2.5,1.5,.01}]; >ListDensityPlot[manSet,Mesh->False,ColorFunction->Hue,AspectRatio->Automati c] > > Anyone got any other ideas? > >Jon Prudhomme >The Evergreen State College >prudhomj at elwha.evergreen.edu > > >PS - The algorithm for the Mandelbrot set is z[[n]]=z[[n-1]]^2+c where >z[[0]]=0 and c is the point on the complex plain being tested as a >member of the set. If after an arbitrary number of iterations the >point is not 2 units away from the origin on the complex plain, the >point c is a member of the set. Colors of non-member points are based >on the iteration number that them as excluded from the set. > > > >