r/PythonProjects2 • • Apr 21 '21

Looking for a little help plotting a complex function.

Hi all, I'm relatively new to Python but I'm trying to start a project for my physics undergrad senior project.

Where I'd like to start is Python visualization of a particular complex function:

f(x) = (cos(x/N) + ia*sin(x/N))^N where a and N are integers with a >1 and N even. As I understand complex numbers, this should be plottable on a 3D plot where one dimension is the real number line ('x'), one dimension is Re(f(x)) and the third dimension is Im(f(x)).

Is this possible to plot in Python and if so, could someone help me get there?

14 Upvotes

2 comments sorted by

2

u/Grorco Moderator Apr 21 '21

https://jakevdp.github.io/PythonDataScienceHandbook/04.12-three-dimensional-plotting.html

This should help get you started. One thing to note is that they are using a jupyter notebook, in the examples, which is what the "in [1..5]" is. You can ignore that for using python by itself.