3 May 2021

A Crash Course on Complex Numbers


z = a + b*i

a, b are doubles (floating-point numbers)

a is the real part of z
b is called the imaginary part of z

+

i terms are unlike non-i terms
To add, combine like terms

3 + 4i + 6 - 2i

9 + 2*i


-

3 + 4i - (6 - 2i)

distribute negative, combine like terms.

-3 + 6i


*

i*i = -1

(3 + 4i)*(6 - 2i)

= 18 - 6i + 24i - 8*i*i
= 26 + 18i

conjugation:

a + bi -> a - bi  (change sign of imaginary part)

(a + bi)*(a - bi) = a*a - abi + abi - b*b*i*i
                  = a*a + b*b  (notice: this is a positive real number)
                  = |a + bi|^2  (distance to the origin)

            1              a - bi
        ----------  =  -------------
         a + bi        (a + bi)(a - bi)

                          a - bi                   
                    =  -------------
                        a^2  + b^2

                           a                b
                    =  ----------  - i  -----------
                       a^2 + b^2        a^2  + b^2
  

/

   z/w = z*(1/w)

powers: repeated multiplication