### Complex Function Grapher

 This applet graphs complex functions where the domain is the base plane, the modulus is graphed on the vertical and the color represents the arguments. See the help text for more details.

#### Help Text

Graphing a complex function is difficult because you need 2 (real) dimensions for the domain and 2 (real) dimensions for the range - a total of 4 dimensions. In this applet, the domain of a complex function is graphed on the base plane. The range is graphed using polar coordinates. The modulus (magnitude) of the complex function is graphed on the vertical axis. The argument (angle) is graphed by using different colors - light blue for positive real, dark blue (shading to purple) for positive imaginary, red for negative real, and yellow-green for negative imaginary. This allows four dimensions to be represented in three spatial dimensions, which are then projected onto a two dimensional screen using a simple orthogonal projection.

Enter complex functions into the f(z) = text box using standard calculator notation. You must use * for multiplication, i.e. 2*z not 2z. Functions must have parentheses, i.e. sin(z) not sin z. The parser understands the following operations, functions, and constants: +, -, *, /, ^, sqrt(), sin(), cos(), tan(), exp(), ln(), log() (synonymous with ln), sinh(), cosh(), abs(), mod() (synonymous with abs), arg(), conj(), e, pi, i.

To adjust the domain of the graph, right-click (or shift-click if you have a one-button mouse) on the graph. The domain editor only accepts numerical input, i.e. 3.14 not pi.

One referee tried checking identities using this applet and discovered some peculiar effects which are explained here.

#### Typical Assignments

I usually go over a couple of graphs with students in class the first time I introduce this applet to be sure they understand what they are looking at. For example, we will look at the first three functions listed under the argument principle below in class. I use both the Top View and the Side View initially; afterwards students often use both views but occasionally find just one view is sufficient for a particular assignment. Once the students are comfortable with the graphs, I have them work look at graphs and discuss them in pairs, then write short individual answers about what they observe, often asking them to verify mathematically patterns they notice. I've listed typical graphs I ask students to look at when studying particular ideas below.
• The argument principle
• f(z) = z
• f(z) = z^2
• f(z) = z^2+1
• f(z) = 1/z
• f(z) = (z^2 + 1)/z

• Branch cuts and Riemann surfaces
• f(z) = sqrt(z)
• f(z) = -sqrt(z)

• Periodicity of the the complex exponential function
• f(z) = exp(pi*z), or alternatively
• f(z) = exp(z) (change domain to -6.28 <= Im(z) <= 6.28)

• Regular and hyperbolic trig functions
• f(z) = cos(pi*z)
• f(z) = cosh(pi*z)
• Alternatively they can look at cos(z) and cosh(z) with the domains set to
-6.28 <= Re(z) <= 6.28, -2 <= Im(z) <= 2 for cos and
-2 <= Re(z) <= 2, -6.28 <= Im(z) <= 6.28 for cosh

Return to top

#### Documentation and Source Code

The documentation was produced with javadoc and is designed to document the use of the classes developed for this applet for programmers who want to use the classess as-is in their own projects. Commented source code is also provided for programmers who want to modify these classes and also for the applet itself (which is basically just a user-interface). The code is copyrighted but may be used freely for non-commercial purposes provided the original source is acknowledged and the author is informed. Contact the author at bennett@math.ksu.edu

 File Documentation Source Code CompGraph Using the CompGraph class CompGraph.java Functionz Using the Functionz class Functionz.java Complex Using the Complex class Complex.java CGApplet CGApplet.java

Please report any problems with this page to bennett@math.ksu.edu
©2001 Andrew G. Bennett