Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!EN.ECN.PURDUE.EDU!eldorado From: eldorado@EN.ECN.PURDUE.EDU (David D Jansen) Newsgroups: comp.sys.apple Subject: AE, Mandelbrot generator Message-ID: <9002071850.AA29665@en.ecn.purdue.edu> Date: 7 Feb 90 18:50:34 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 66 Keywords: mandelbrot Could someone with fractal experience tell me why I get weird data. It gets the basic shape but not quite right. A friend of mine (a fractal "guru") can't make out what the problem. Here is my type declaration: type imaginary = record {an imaginary number i.e. a + bi} a : real; b : real; end; region = record {a rectangle on the imaginary plane} amin : real; bmin : real; amax : real; bmax : real; end; screen = record {the data that describes a screen} where : region; bitmap : packed array [1..hor,1..ver] of boolean; end; procedure plotset (var pages:screen;var fraccalc:boolean); {a procedure to put the fractal from the sent region into the variable page} var dval,z,val:imaginary; h,v,n:integer; begin dval.a:=(pages.where.amax - pages.where.amin)/(hor - 1); dval.b:=(pages.where.bmax - pages.where.bmin)/(ver - 1); for v:=1 to ver do begin for h:=1 to hor do begin val.a:=pages.where.amin + (h - 1) * dval.a; {val is the value of the} val.b:=pages.where.bmin + (v - 1) * dval.b; {current point on the screen} n:=0; z.a:=0; z.b:=0; while ((z.a*z.a) + (z.b*z.b) <= 4) and (n < maxiter) do begin z.a:=(z.a * z.a) - (z.b * z.b) + val.a; z.b:=2 * z.a * z.b + val.b; n:=n + 1; end; if (((z.a * z.a) + (z.b * z.b)) <= 4) then pages.bitmap[h,v]:=true end; writeln (v/ver*100:5:2,'% done'); end; fraccalc:=true; end; Someone last year uploaded a mandelbrot generator and I modified his code to test in my program. No go, it was worse than my attempt. I don't think I tested my code in his program. That was a mistake on my part. I have had this problem for more than a year. There could be a reward for the correct answer. While I am at it, what is Applied Engineering's phone number? Did anyone download the Prodos Hyper C that was uploaded? Did it work? Dave Jansen (The Gilded One) eldorado@en.ecn.purdue.edu "We have to make all our programs idiot-proof. Idiots are very intelligent!"