
Phase Plots of Complex FunctionsThe concept here is quite simple: visualize the values of a complex function by mapping them to colour, using multiple dimensions of colour space to capture the two dimensional result. It is useful to use the polar coordinate representation here and use the modulus or magnitude of the polar coordinate vector and the phase angle or angle of the polar coordinate vector to drive the colour choice. Zeros of the complex function will then naturally map to wells of colour. A complex number Many colour schemes are possible. See [1] for some examples and discussion. Typically the angle is mapped to hue and the modulus is mapped to brightness in some fashion. Linear or logarithmic mappings can be used. Since human colour perception is not uniform, naive mappings can create artificial perceptual discontinuities. These may produce beautiful results, but they can be misleading. For example, here is figure 1 from [1]. The colour banding such as between yellow and red here is an artifact of the colouring. My approach is to map the hue onto a perceptually uniform and ordered gradients, such as those in [2]. Compare the dark banding in the first gradient below to the smoothness of the second. The gradients colours are converted into HSL colour space, then the angle of the function is used to select the appropriate colour. I use the hue and saturation values as is and blend the lightness value with a value mapped from modulus. So: function values get darker as they approach zero and span the colour range as they rotate. Linear gradients will produce a strong discontinuity at 360°. Circular gradients will smooth this out. Compare these two plots of complex modulated torus knots. The first one uses a linear gradient and shows the discontinuities. The second uses a circular version of that gradient and is smooth: the remaining colour discontinuities reflect properties of the underlying function. Uninterpolated gradients with few colours will also also produce strong discontinuities, at the angles corresponding to the number of colours. This image uses a gradient with only five colours, so the discontinuities are every 72 degrees. Interpolating the gradient to produce more base colour values can smooth this out. Similarly when a split gradient is used. This image uses a gradient designed for topographic uses with a strong discontinuity in the middle (where the land meets the sea). We therefore see two discontinuities: one at the end of the gradient (360°) and one where the two subgradients meet (180°). The final pieces of the puzzle are the selection of the complex function to map and the calculation of that function (i.e. mathematical operations over complex functions). Let's take the second part first. Wikipedia's article on complex numbers has some information on how to compute some operations; a nice summary as well as information on trigonometric functions is at the Milefoot mathematics page. For complex numbers
As far as which function to plot, for artistic purposes a function with a lot of zeros and a complicated surface make for more interesting results. The modulated torus knots (above) are, let us be honest, a little boring. Dividing one polynomial function by another often produces interesting results. One class of functions that reliably produces nice images is finite Blashcke products. Given a set of points
