What free tools can I use to plot complex functions on the complex plane?

I would like to plot $y = e^{ix}$ to view the imaginary unit circle and then change different parameters to see what happens. I am having trouble getting wolfram alpha to do this though. Is there a good way?


Solution 1:

First you must define your complex function as a curve in $\Bbb R^3$ using a parameter, by example $t$, and separating each coordinate.

In our case we have that

$$f(x):=e^{ix}=\cos (x)+i\sin (x)$$

then we can transform the graph of the above function in a parametric curve in $\Bbb R^3$ writing

$$\gamma (t)=t\cdot{\bf i}+\cos(t)\cdot{\bf j}+\sin(t)\cdot{\bf k}$$

Then the image of $\gamma $ is the graph of $f$. Using Geogebra we can write in the algebra view

Curve[t,cos(t),sin(t),t,-5,5]

and the graph can be viewed in the 3DView tab. Indeed Geogebra is an extraordinary tool due to it simplicity and portability. We can define applets easily as this (with little work we can add text boxes or buttons for any kind of interactivity!)

Using the Wolfram language (in wolfram alpha or the Wolfram programming lab) we can write

ParametricPlot3D[{t,Cos[t],Sin[t]},{t,-5,5}]

And with a very similar code we can write in SageMathCell

t = var('t'); parametric_plot3d([t,cos(t),sin(t)],(t,-5,5), aspect_ratio=[1,1,1], zoom=1.5)

(the result can be seen here).

There are a lot of different tools to graph online, by example I discovered today the library plotly that can be used in many programming languages (and online too!). It homepage is full of tutorials for any kind of plot, in our case we have a tutorial for a curve in $\Bbb R^3$ here.

Solution 2:

I found that this website is pretty good. I would prefer if it plotted in 3D, but you can get a pretty good sense using the color mappings in 2D.

Basically what it will do is display phase as a color and the magnitude as the lightness/darkess of the color. (Larger magnitudes get represented by lighter colors.)

http://jutanium.github.io/ComplexNumberGrapher/

Solution 3:

cplot is a Python package I wrote. It uses domain coloring and associates brightness to the modules of $f(z)$, and hue to its argument.

For the function $f(z) = z^6 + 1$:

import cplot

plt = cplot.plot(lambda z: z ** 6 + 1, (-1.5, +1.5, 400), (-1.5, +1.5, 400))
plt.show()

enter image description here