This project generates 3D graphs, based on the logarithms of complex numbers. By writing a complex number in the form reia where r is the modulus of the complex number and a is the angle from the real plane, it is easy to take the logarithm of that complex number.
Log(z) = log(reia) = log(r) + log(eia) = log(r) + ia
The domain must be restricted because the function is periodic, since adding multiples of 2Pi gives the same result. Therefore the graphs generated show a single branch, and do not represent the entire function. Currently, by changing the num_levels variable you can stack branches.
These instructions will help you to get you a copy of the project running on your local machine.
You will need these python modules to be able to run the project.
matplotlib - pip install matplotlib
numpy - pip install numpy
Clone this repository using terminal:
git clone https://github.com/LucasBN/Complex-Logarithms.git
To run the program open the cloned repository in terminal and type:
python main.py
The imaginary part over the complex plane:
The real part over the complex plane:
The imaginary part over the complex plane (two branches):
To plot your own function over the complex plane, create a function that returns a value for z given a complex number. (See example functions.)
Once you have created your function, make sure to assign the zs variable to its return value, by changing:
zs[xi,yi] = complex_log_real(z)
To:
zs[xi,yi] = new_zs_function(z)
- Lucas BN - Initial work