Have you ever tried to visualise the graph of a complex function $ f:\mathbb{C}\to\mathbb{C}$? The problem with complex functions is that usually we graph a complex number as an ordered pair $ (x,y)$ on a Euclidean plane, which corresponds to $ z = x + iy$. Unfortunately, this means that if we want to graph complex functions as we do real functions, we need to draw the graph in four-dimensional space! Some people have actually claimed the ability to visualise this, but I do not!

However, if we use time as a dimension, we could represent four dimensions as a moving three-dimensional image in time, like a movie. Sometimes, it's hard to draw three dimensions in two dimensions, though we don't actually lose too much because we can only see a two-dimensional picture of a three-dimensional scene at any given time.

There are a few animations in this post; they may take a few seconds to load, or a few minutes on a slower connection.

### Adding in Colour

If we add colour as another dimension, we can try and represent four dimensional objects on a Cartesian plane where every point has four coordinates $ (x,y,c,t)$ where $ x,y$ are the spatial coordinates, $ c$ represents the colour, and $ t$ represents time. Here by colour we can use something like the colours from red to violet in the usual rainbow to represent an interval.

Of course there is still a problem in that two points might have the same $ x,y,t$ but a different colour, but that is the same problem that we have with plotting three dimensions on a two-dimensional piece of paper, so we're doing alright! Furthermore, we could use techniques like plotting translucent points to give a better effect.

### Examples

Suppose we did this for the complex exponential function $ f:\mathbb{C}\to\mathbb{C}$ defined by $ f(z) = e^z$, or in other words, defined by $ f(x + iy) = e^x(cos(y) + i\mathrm{sin}(y))$. There is some choice as to what the $ x$ and the $ y$ should be, and changing coordinates will change our view of the object.

I'm going to do something a bit different than above and say that $ x$ will represent time and $ y$ will represent the colour, with "red" starting and zero and "violet" ending at around $ 2\pi$, with the interval mapped onto the usual rainbow spectrum going red-orange-yellow-green-blue-indigo-violet. So if we plug in a "time" and a "colour" to the exponential function, we get a point on the complex plane, and we can plot it as an animation:

Notice that the colour variable shows the periodicity and the expansion is growing exponentially as a function of time, of course. We can do something similar with the function $ f(z) = z^2 + 1$ and get:

Of course this graph is a bit misleading since I really only plotted this function for positive values of $ x,y$, but it would be easier to make a more accurate plot.

This kind of graphical representation has all sorts of cool uses: it works anytime you have four variables and you want to create a four-dimensional graph. Of course it has to be animated because time represents a dimension in this method.

Here is something closer to elementary number theory: consider the function $ f:\mathbb{Z}^3\to\mathbb{Z}$ given by $ f(i,j,r) = i^r + j^r\pmod{50}$. I just chose 50 at random. We could consider $ r$ as time, and at the point $ (i,j)$ on the plane, we could plot $ f(i,j,r)$ as a colour where red starts at 0 and the most violet is 49, giving another animation. This function is pretty cool looking, and has some unusual features when $ r$ takes on a value like 21. Here is the animation (the value of $ r$ is displayed at the top).

Here is is the graph for when $ r=21$:

*Acknowledgement.* Each static image was made with The R Statistical Computing Software and animated with The GIMP.