# Domain coloring for visualizing complex functions

$f(z)=z^3+c$

## Basic Tools: Real and Imaginary components

With the following tools you just need to enter the real and imaginary components of a complex function $$f(z)=\text{Re}(x, y)+ i \,\text{Im}(x,y).$$

Open the tool by clicking on the image.

HSB enhanced scheme

Plots the level curves of the modulus and phase of $f(z)$.

HSB enhanced scheme

Plots the level curves of the modulus, imaginary and real components of $f(z)$.

RGB enhanced scheme

Plots the level curves of the modulus and phase of $f(z)$.

## Advanced Tools: General complex functions

Open the tool by clicking on the image.

HSB enhanced scheme

Plots the level curves of the modulus and phase of $f(z)$.

HSB enhanced scheme

Plots the level curves of the modulus, imaginary and real components of $f(z)$.

HSB smooth enhanced scheme

Plots the modulus of $f(z)$ using a Gradient method.

HSB enhanced scheme

Plots the level curves of the modulus and phase of $f(z)$.

Black & White enhanced scheme

Plots phase, modulus, real and imaginary components of $f(z)$.

## Notes about the basic tools

15-July-2018

For these tools I used the enhanced phase portrait based on the work of E. Wegert [see 11,13]. The Hue-Saturation-Brightness (HSB) color scheme is used. For plotting the level curves of the modulus I used the following equations:

\begin{eqnarray*} \text{H}&=&\frac{\pi - \text{atan2}(y, -x)}{2\pi},\\ \text{S}&=&1,\\ \text{B}&=&\frac13\left(\log_{1.6}\left(\sqrt{x^2+y^2}\right)-\text{floor}\left(\log_{1.6}\left(\sqrt{x^2+y^2}\right)\right)\right)+0.7 \end{eqnarray*}
where $x,y$ are the real and imaginary components, respectively. The p5.js function colorMode() is used for all tools.

Others things to try:

• Change the real and imaginary components.

Example 1: $f(z)=z^3-1$
Re: pow(x, 3)-3*x*y*y-1
Im: 3*x*x*y - pow(y, 3)

Example 2: $f(z)=\log(z)$
Re: log(sqrt(x*x + y*y))
Im: atan2(y, x)

Example 3: $f(z)=\sin(z)$
Re: sin(x)*( ( exp(y) + exp(-y) ) / 2 )
Im: cos(x)*( ( exp(y) - exp(-y) ) / 2 )

List of available built-in functions is available here.

The source code is available at GitHub

If you find issues send me an email: j.ponce@uq.edu.au

## References

1. Ablowitz, M. J. & Fokas, A. S. (2003). Complex variables: introduction and applications (2nd ed). Cambridge University Press.
2. Breda, A. Trocado, A. & Santos, J. (2013). O GeoGebra para além da segunda dimensão. Indagatio Didactica, 5(1). Recuperado el 12 de junio de 2018
3. Davis, J. E. (2017). Complex Domain Coloring, Available online
4. Crone, L. (s.f) Color graphs of complex functions.
5. Farris, F. (1997). Visualizing complex-valued functions in the plane.
6. Farris, F. A. (1998). Review of Visual Complex Analysis. By Tristan Needham. American Mathematical Monthly 105 (1998), 570–576.
7. Losada Liste, R. (2014). El color dinámico de GeoGebra. Gaceta De La Real Sociedad Matematica Española, 17, 525–547, Madrid.
8. Lundmark, H. (2004). Visualizing complex analytic functions using domain coloring.
9. Needham, T. (1997). Visual Complex Analysis. Oxford University Press, Oxford.
10. Marsden, J. E. & Hoffman, M. J. (1987) Basic Complex Analysis. (2nd ed.) W. H. Freeman and Co, New York.
11. Wegert, E. (2010). Phase diagrams of meromorphic functions. Comput. Methods Funct. Theory 10, 639-661.
12. Wegert, E. (2012). Visual Complex Functions: An introduction with phase portraits. New York: Springer Basel.
13. Wegert, E. (2016). Visual exploration of complex functions. In T. Qian and L. R. Rodino (eds.), Mathematical analysis, probability and applications – Plenary Lectures SPMS (Vol. 177. pp. 253–279). Switzerland: Springer International Publishing.
14. Wegert, E. & Semmler, G. (2011). Phase plots of complex functions: a journey in illustration. Notices American Mathematical Society, 58, 768-780.