This series aims to teach you the basics of programming fractals. Let’s start with introducing Complex Numbers, which is a topic within algebra and the fundamental for everything that is related to fractals. In the next tutorial, we will move more towards the theory of fractals.
All complex numbers are represented by the form x+yi, where x and y are real numbers (positive, negative or zero), and the symbol for the set of complex numbers is C. This can be represented in a two dimensional coordinate system, the complex plane (C):
Say we have the function z = x+yi. In this function, x is what we call the real (R) part of z, and y is called the imaginary(i) part of z. In other words, in our graph above, the x axis is the real axis, and the y axis is the imaginary axis. A real number 8 is a function of the complex plane where y = 0 and x = 8. The formula z = x + yi = 8 + 0*i = 8, z = 8 shows us this.
So what’s happening here? We take the square root of a negative number? But that’s not possible! Sure, but this is where the i comes in. Everyone knows that i isn’t real, so that’s why it’s imaginary. It brings a few handy things to us, one is that it makes it possible to take the square root of a negative number:
That’s correct, and that’s what gives us the benefits of being able to take the square root of negative number. But, it will also require you to keep this in mind when dealing with the imaginary number.
Let’s take an example. We all know that the square root of 25 is 5. Lets see what the square root of –25 is:
Addition/Subtraction of Complex numbers
It is very simple to add or subtract two complex numbers together. Say we got two complex numbers where one is z=-3+2i and another is w=4+3i, and we want to add these together (z+w):
If yi*vi = 3i2, it’s result will be –3.
(x + yi)(u + vi) = (xu – yv) + (xv + yu)i
The product of (1+2i)(3+4i) is: (3 + 4i + 6i + 8i2) = (3 + 1oi –8) = (-5+10i)
Simply multiply both parts of the complex number by the real number.
This is just a brief introduction to complex numbers, but enough to get you started with fractals.
Any feedback and sources of confusion/mistakes are very welcome, see you next time!