# Complex Computations, Introduction

Complex numbers are numbers with a real part and an imaginary part. Like:

x = x.r + i * x.i

x.r is the real part of x and a real number,
x.i is the imaginary part of x and a real number also,
i is the imaginary unit equal to the square root of −1, i = sqrt(−1) or i*i = −1.

Just as 4 has two square roots, 2 and −2, 2 being the principal square root; −1 has two square roots, i and −i, i being the principal square root. If x.i = 0, we call x a real number. If x.r = 0 and x.i != 0, we call x an imaginary number. The complex number x can also be written and plotted as a 2-dimensional vector x = {x.r, x.i}.

Many of the computations we perform with real numbers can also be performed with complex numbers. See the following topics to learn how. The complex operations and functions are evaluated in terms of real functions and operations. So you will need a way to do real calculations, for example my program XPCalc. XPCalc's documentation and source code tell how to do the real computations.