You may not have heard that Benoît Mandelbrot (November 20, 1924  October 14, 2010) recently passed away. In his honor, I decided to enhance the Mandelbrot set program shown in an earlier example. For more information on Benoît Mandelbrot, see Wikipedia or his New York Times obituary.
The example Use a Complex class to draw the Mandelbrot set easily in Visual Basic .NET explains how to draw a Mandelbrot set by iterating the equation:
Z_{n} = Z_{n1}^{2} + C
Where Z_{n} and C are complex numbers. The program iterates this equation until the magnitude of Z_{n} is at least 2 or the program performs a maximum number of iterations. At that point it uses the number of iterations to determine a color for the pixel. If the program performed num_iterations iterations and is using num_colors colors, then the program colors the pixel Colors[num_iterations % num_colors].
This example modifies the coloring algorithm to produce smoothly varying colors. First note that the following value mu approximates the fractional number of iterations that would be needed before the magnitude of Z_{n} is at least 2.
mu = iteration + 1  Math.Log(Math.Log(Z.Magnitude)) / log_escape
Here iteration is the number of iterations actually performed, Z.Magnitude is the magnitude of Z right after the magnitude is greater than 2, and log_escape is the logarithm of the escape radius 2.
This value only approximates the actual expected fractional number of iterations and there is a noticeable error where the colors don't blend smoothly. Fortunately it's easy to reduce the error by using a later value of Z_{n}. For example, if you use Z_{n+3}, then the error isn't noticeable. The following shows the code used by the program to calculate mu.
