A Complex number is a combination of real number and an imaginary number.
For example: 3 + 2i –> This is a complex number in which 3 is the real number and 2i is the imaginary number.
i –> is the imaginary number that is imagined as the square root of -1 i.e., √-1.
Below are few examples of complex numbers:
- 3i
- -4.3i
- 57i
- 43i/4
i is the imaginary number that depicts that it should be multiplied by √-1.
Complex number is a number which is dependent on two numbers. One number is a real number and the other number is the imaginary number.
Say for example, 2 x 3 = 6, here 6 is dependent on two numbers 2 and 3.
Likewise, complex number is also a number that is dependent on two numbers for which the value of one number is known whereas the value of the other number is unknown.
| Complex Number | Real Part | Imaginary Part |
|---|---|---|
| 6 + 5i | 6 | 5 |
| 2 | 5 | 0 |
| −9i | 0 | -9 |
The above table gives a clear understanding on the understanding of complex numbers.
Now, we have a basic understanding of complex numbers. Let’s get back to Python.