Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!mips!apple!motcsd!xdos!doug From: doug@xdos.UUCP (Doug Merritt) Newsgroups: comp.graphics Subject: Re: Mandelbrot algorithm summary Keywords: mandelbrot algorithm Message-ID: <652@xdos.UUCP> Date: 7 Feb 90 16:08:48 GMT References: <5480@vax1.tcd.ie> Reply-To: doug@xdos.UUCP (Doug Merritt) Organization: Hunter Systems, Mountain View CA (Silicon Valley) Lines: 34 In article <5480@vax1.tcd.ie> cbuckley@vax1.tcd.ie (Colm Buckley) writes: >Unfortunately, there does not exist in most versions of C any integer type with >greater precision than "long", so any further advances require an assembler >program (don't rush me, I'm working on it!) What? Not at all. You can do extended precision in C. You can't do a 32x32 -> 64 bit multiply in a single step, which *some* (but not all) machines allow in assembler. So, granted, there may be good reason to use assembler for speeding up such operations. But that's really no different than any other algorithm. As usual the smart approach is to get it working in C first, and then (if desired) recode that inner loop in assembler to get some extra speed. But don't go off thinking it's *necessary*. >number of times that the function has to be called. One of the most interesting >came from Alastair Sutherland in SCO in California. He suggests looking for a >rectangle with all edge pixels the same colour, and filling it in, on the >assumption that, if the edge is solid, then the interior is too. See the Although this is a useful heuristic, note that it can fail. Some regions of the set will have a "tendril" that sneaks between two pixels, and then expand to visible size inside the region you've filled in. You should be able to find this effect by trying this algorithm in one of the areas that has a (pseudo-) duplicate of the entire set. These little-M's are generally connected by extremely thin tendrils, so it should be easy to get the tendril to fall between two pixels. For this reason, it's helpful to enhance the basic idea by adding a little double checking. Always probe some number of random points inside the rectangle; if one of them is a different color than you'd expect from the heuristic, do the interior "the hard way". Doug -- Doug Merritt {pyramid,apple}!xdos!doug Member, Crusaders for a Better Tomorrow Professional Wildeyed Visionary