# Exterior Distance

Formalizes the dwell gradient idea, in that closeness of dwell bands is related to closeness to the boundary of the set. In Heinz-Otto Peitgen and Dietmar Saupe’s “The Science of Fractal Images” (1988) Appendix D, Yuval Fisher bounds the distance between a point outside and itself by:
where is the potential of the point . The upper bound can be approximated by using a large escape radius; for escaped :
There is a point in the Mandelbrot set within . No point in the Mandelbrot set is within . Compare with pixel spacing to know if the Mandelbrot set might intersect a pixel.
A complex-valued distance estimate (with directional information) can be calculated by:
Distance estimation (2010) and Circular wavefronts (2010) use distance estimates to give progressively finer approximations to the exterior, while Adaptive super-sampling using distance estimate (2014) describes an adaptive supersampling method.
# 1 C99 Code
#include <complex.h>
#include <math.h>
double _Complex m_exterior_distance
(int N, double R, double _Complex c)
{
double _Complex z = 0;
double _Complex dc = 0;
for (int n = 0; n < N; ++n)
{
if (cabs(z) > R)
return 2 * z * log(cabs(z)) / dc;
dc = 2 * z * dc + 1;
z = z * z + c;
}
return 0;
}