Image may be NSFW.
Clik here to view.
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.
z=x+yi
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):
Image may be NSFW.
Clik here to view.
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.
Let’s take a look at the complex plane between -4+3i to 4-3i, filling out every function on the grid.
Image may be NSFW.
Clik here to view.
The imaginary i
Let’s take a closer look at this imaginary i:
Image may be NSFW.
Clik here to view.
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:
Image may be NSFW.
Clik here to view.
in other words, i2 = –1! But.. wait, can’t i be –1 and 1 then?
Image may be NSFW.
Clik here to view.
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:
Image may be NSFW.
Clik here to view.
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):
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
As you can se, the result will be a parallelogram from origo.
Image may be NSFW.
Clik here to view.
Multiplication of Complex Numbers
Multiplying complex numbers is a bit more complex than addition/subtraction.
The general rule of multiplying complex numbers:
Image may be NSFW.
Clik here to view.
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)
If you want to multiply a complex number by a real number u, the general rule is:
Image may be NSFW.
Clik here to view.
Simply multiply both parts of the complex number by the real number.
The power of i
The last thing I want to cover is the power of i. As we know, our imaginary number got some strange behaviors, and this accounts the power of i as well:Image may be NSFW.
Clik here to view.
Let’s continue with the 8 first:
Image may be NSFW.
Clik here to view.
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! Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Clik here to view.
