Distance Estimator

Robert P. Munafo, 2008 Mar 19.


A less common method of computing an image of the Mandelbrot Set. Distance Estimator allows you to see every pixel that contains any points in the Mandelbrot Set (no matter how few such points there are).

The algorithm is based on the derivative of the iteration function and works because the dwell bands are spaced closer together as you approach a point in the Mandelbrot set. Calcuating the derivative is equivalent to measuring the spacing of the dwell bands.

Distance-Estimator is the best representation function for exploring the Mandelbrot set, and it is used in many good color schemes.

function distance-estimator param(z): complex param(max-iterations): integer result: integer begin function declare c, z, z2, dz : complex declare iterations : integer declare still-iterating : boolean let still-iterating = true let iterations = 0 let c = z let dz = 0 while (still-iterating) do let z2 = z * z + c let dz = 2 z dz + 1 let z = z2 let iterations = iterations + 1 if (magnitude(z) > 2.0) then let still-iterating = false else if (iterations >= max-iterations) then let still-iterating = false end if end while let z = magnitude(z) let dz = magnitude(dz) let result = log(zz) z / dz end function

The value of result is a real giving the approximate distance between the point z and the nearest point that is in the Mandelbrot Set. If you are viewing an area that contains Filaments, then nearly all of the 'interesting' parts of the view will have values of result that are very small positive numbers, like 0.01 or 0.00001.

Since images are usually plotted through a color table, and since color tables resuire an index (like a number from 1 to 100), you will probably want to convert the result of distance-estimator to a color table index. A good formula that accomplishes this is:

let color-table-index = 0 - k * log(distance-estimator(z, max-iteraions))

where k is a constant that depends on the size of your color table and the maximum zoom magnification factor according to the following formula:

k = color-table-size / log(maximum-zoom-magnification)

For example, if your color table has 200 elements and the maximum magnification is 1010, and if log is a base-10 logarithm, then k would be 200/10 = 20.

Distance Estimator for Julia Set Images

According to Milnor (in Dynamics in One Complex Variable, appendix G), the distance estimate for Julia sets is close to the ratio magnitude(G)/G', where G and G' are defined as follows:

G(Z0) = limit(k->infinity) [log(magnitude(Zk)/2k]
G'(Z0) = limit(k->infinity) [magnitude(dZk) / (2k magnitude(Zk))]
dZk = 2k Zk-1 Zk-2 ... Z2 Z1 Z0

When one of the Zk is close to 0 (that is, for points near the origin and any points with an iterate that maps onto the origin) the distance estimate is inaccurate.

See also interior distance estimate



Acknowledgments

The Distance Estimator method was pioneered by Thurston, and was made known to the general community by Peitgen and Richter in their book The Beauty of Fractals. The actual algorithm is presented in The Science of Fractal Images, page 198, where it is called DEM/M.



From the Mandelbrot Set Glossary and Encyclopedia, by Robert Munafo.     Mu-ency index


WWW: http://www.mrob.com/
click here to email me
© 1987-2009 Robert P. Munafo.s.13