Complex Domain Coloring
Complex Domain Coloring was introduced to me by Jan Hlavacek as a way of visualizing a function of a complex variable by associating a complex number with a color. The basic idea is to express the color in its HSV representation, where the phase of the complex number determines the color's hue, and the modulus of the complex number gives the color's saturation and value.
With built-in support for complex numbers and an easy to use PNG module, S-Lang is ideally suited for this sort of task. In fact, the background image that you see on this page was created through this technique using the function:
To facilitate the creation of such images, I wrote a S-Lang script called fztopng that converts a user-specified function of a complex number to a PNG image. For information about obtaining fztopng and more details about its use, see its page.
will be used to illustrate some of the capabilities of the fztopng. Here is what it shows the function to look like using the default coloring scheme:
fztopng also supports a coloring algorthm based solely upon the phase of the complex number. The phase is then used to linearly interpolate between two specified colors. Here is what the function looks like when colored using this algorithm:
Very interesting pictures result when functions are iterated. For example, the first iteration of f(z) is
The first iteration colored with the phase-only algorithm looks a bit like a coat-of-arms:
And the 10th iteration of f(z) resembles an Oriental rug:
This page was last updated Mar 11, 2013 by John E. Davis. To comment on it or the material presented here, send email to jed at jedsoft org.