Visualising a function usually means plotting a graph. For each point, we record an input
and the corresponding output under the function f, but what if both input and output are complex
numbers? As said in the previous video, a complex number is represented with a complex
plane, a 2-dimensional object, so both the input and output are 2-dimensional, which
means we actually need 4 dimensions to properly graph it. We live in a 3D world, so how do
we visualise a complex function then? There are, actually, at least 5 ways of doing it.
Of course, different methods have their own pros and cons, but I want you to leave a comment
on which is your favourite. In this video, I’m going to briefly explain what these
methods really are, then use some examples to illustrate how they are used to visualise
complex functions. First, let’s see what is “domain colouring”.
[Domain colouring]
For this method, we basically treat the complex plane as a canvas for us to paint a picture.
For a complex function, each point on the complex plane is the input, and we need to
find a way to represent the output. Let’s say 1+i is mapped to 3-4i, then at the *position*
1+i, we colour it with a colour that represents 3 - 4i. The question is what should be the
colour? Well, we can refer to a colour wheel. With the appropriate real and imaginary axes
drawn, and rescaling, 3 - 4i is here, which corresponds to a bright pink colour, so we
should colour this point bright pink as well. Then repeat this for all the other points,
and we are done.
But what was that colour wheel in the first place? The first thing to note is the hue,
from red, to green, to blue, then back to red again. Because of the periodicity, this
naturally corresponds to the argument of the output, and the modulus is represented by
another attribute of colour, in this case, the lightness. Basically, in the middle, the
colour is black because there is 0 lightness, and as the modulus increases, it becomes whiter
and whiter. This is convenient because a black spot is precisely where the function is 0,
and the white spots are where the function is shooting off to infinity.
For example, in this domain colouring plot, can you find out the zeros of the function?
[wait 3 seconds] Well the black spots are here. What about the places where the function
blows up? [wait 3 seconds] Well the white spots are here. So if you are particularly
interested in zeros and “infinities”, then it is a nice way of visualisation. By
the way, this particular black spot is quite different from the other two. Can you figure
out, visually, what is the difference? And could you explain this difference if the function
is given like this? Don’t worry if you don’t know the answers - it is completely optional,
but if you do, leave a comment down below!
[3D plots]
The second way would be 3D plots. For any complex function having its input and output,
originally, we would want to plot points like these. The first two represent the input,
x + iy, and the last two represent the output, u + iv. But we are 3D creatures, so we need
to sacrifice one coordinate, and plot these points instead. The missing coordinate, in
this case, the imaginary part of the output, is represented by the colour. For this reason,
let’s call the resulting plot the Re-Im plot. For instance, this is the Re-Im plot
of the exact function we have seen before. These two spots are where the function shoots
off to infinity, but the zeros of the function are not as obvious. Even if we rotate the
surface a little bit, it is not immediately obvious where the zeros are.
But let’s take a step back - why do we have to sacrifice the imaginary part in particular?
We could have coloured the real part instead, making it the Im-Re plot. We can also instead
keep the modulus of the output, and the argument is represented by colour. If we do this, we
can call it the Mod-Arg plot. If we do the Mod-Arg plot of the same function, we get
this. Again, the infinities are quite obvious, but this time, the zeros are a bit more obvious
as the lowest possible points of the plot, which is somewhat close to the feature of
domain colouring. However, the previous Re-Im plot isn’t completely useless. As I said
in the introductory video, both real and imaginary parts of a nice complex function satisfy an
important differential equation, and we call such a function harmonic, and so the Re-Im
plot visualises the contours of a harmonic function, which is still important.
[Vector fields]
Alright, we get on to the third method - vector fields. The rationale is similar to domain
colouring. Again, we have a complex function with its input and output, but this time instead
of colours, we use vectors to denote the output. Let’s reuse the example where 1+i is mapped
to 3-4i. The point at the position 1+i should be attached with the vector corresponding
to 3-4i. However, unlike domain colouring, we can’t do this to all the other points.
If we do, this is the result. You can’t see anything. Instead we only consider a small
number of points on regular intervals. But well, some vectors are way too long to clutter
up the plot, so we need to standardise the size, and the missing information about the
length can be represented as colour in this more refined vector plot.
A slight variant is obtained when we consider this as a velocity field, so a particle would
follow a trajectory whose instantaneous velocity is dictated by the vector plot. If we do that
to a lot of particles, the result is this: a streamplot. This can be made more dynamic
by particle animations, but what’s more interesting is the Pólya vector field. Instead
of plotting f(z) directly, we plot its conjugate. Why? The resulting flow is physical: more
specifically, it represents an inviscid, incompressible, irrotational flow. Mathematically, for nice
complex functions, the divergence and curl of the Pólya vector field is 0, but we will
talk about it much later on in the video series. For now, let’s go to the fourth visualisation
method.
[z-w planes]
This z-w plane method is exactly the same as the transformation I have talked about
in the Jacobian video. Let’s say, again, 1+i is mapped to 3-4i. So the point at the
position 1+i, under f, would need to move to 3-4i. Since usually we denote z is the
input, and w as the output of a complex function, the input is called the z-plane, output the
w-plane. Let’s see what the squaring function looks like. We first construct the z-plane
with these gridlines, and here we go. The result is the w-plane. The most noticeable
feature of this method of visualisation is that these angles at intersections are still
right angles. The only exception is this - the angle doubles to 180 degrees. This is not
a coincidence, but again, the explanation is going to have to wait.
However, you might have a question: the z-plane is always going to be the grids, so why bother?
We can simply draw the w-plane. You might expect my response to be that the transformation
animation was great, which it is, but that’s not it. I could have chosen any transformation
- just that in this case, the most natural transformation is to let the exponent go smoothly
from 1 to 2, but that’s not the only choice. This is another choice of transformation that
is also quite smooth. My point is, that’s right: only the resulting w-plane is important.
But the z-plane is important in the following way if we don’t use the whole complex plane.
For instance, what happens to a circle if we apply this function instead? By the way,
this function is called the Joukowsky transform. Can you guess what the image of this circle
would be? Just guess.
Let’s see the answer. (wait 2 seconds) In case you haven’t noticed, this looks like
an airfoil. The result is called Joukowsky airfoil. Historically, this is a good tool
to understand the aerodynamics around an airfoil, because airflow around a circle is relatively
easy, while directly studying the flow around the airfoil is much harder. More specifically,
given a circle, the potential flow around it is a standard problem in fluid dynamics,
and we can apply the Joukowsky transform to find the fluid flow around the airfoil, which
is a complicated shape. That’s probably too much of a tangent, but my point is that
z and w planes are both useful when we want to see the image of a subset of the plane.
And we get to the final way of visualisation.
[Riemann sphere]
This method is very similar to the previous one. We have the input sphere, the z-sphere,
and the w-sphere being the output under the function f. Essentially, a point on the sphere,
somehow representing a complex number z, is mapped to f(z), represented by another point
on the sphere. The only thing we need to know now is how complex numbers are represented
on the sphere.
In the 3D space, we consider the x-y plane as the complex plane, and the sphere is actually
a unit sphere centred at the origin. Now consider the top point as the light source shining
onto the complex plane, so this point on the sphere would cast a shadow on the complex
plane. That shadow point is the corresponding complex number. However, calling it a shadow
isn’t entirely accurate, because a point in the southern hemisphere wouldn’t really
cast a shadow on the plane, rather, the reverse. What I mean is that a point on the plane casts
a shadow on the sphere instead. But still, that point on the plane is the corresponding
complex number. That means, basically, we can identify the entire complex plane with
the sphere, but without that light source, because that light source wouldn’t cast
a shadow.
With that, let’s take a look at how the squaring function looks like. (Wait 2 seconds)
Again you might be able to notice that the angles are right angles, but it might be less
obvious that near the south pole, the angles double. And you might also realise that the
south pole corresponds to 0 as a complex number. Remember that for the same function, in the
z-w plane example, the angles at 0 also double. So in terms of angles, these two methods are
very similar. However, in fact, angles at the north pole also double. It’s just that
this point doesn’t correspond to any complex number. But it’s a little troublesome to
always exclude the north pole, so we correspond this point to something called infinity, and
we can do arithmetic with it in a very precise sense, but that will have to wait until we
talk about Möbius maps.
So, out of the five methods, which one do you like the most? Let me know in the comments!
Before you go, I just want to say that these animations do take a huge amount of time and
effort, so if you want to and can afford to, please consider supporting on Patreon, where
you will see the video at least 24 hours before it goes public. The next video will continue
complex function visualisation, tackling specific common functions, and finding some possible
problems with them. In any case, if you are new here, consider subscribing with notifications
on, liking the video, and of course, do comment and share the video as well! See you next
time!