Complex Function Grapher: A Cube implementation of Tom Banchoff's work

By: Matthew Hoffman

Last updated: 10/28/11


The goal of this project is to create an Aszgard application in pyOpenGL that will run in the Cube. The application will graph functions of complex numbers, rotating through the fourth dimension and projecting into the third for display, also showing the fourth dimension as color.


The Complex Function Grapher (CFG) is designed to visualize complex functions by their graphs. The difficulty is representing C2 space, which is isomorphic to R4 space, and thus unable to be drawn or displayed in a simple manner. To achieve this, the CFG plots the points in 4 dimensions, rotates them through those 4 dimensions by varying angles, and then projects the result onto 3 dimensions for display in the Cube. The user is able to choose the function to be graphed and alter the rotation through the 4th dimension.

Current State:

The program is currently able to graph the function projected into 3 dimensions, and it is able to rotate in the XW, YW, and ZW planes. The four dimensionsion variable is also represented by the color of the graph. I have gotten a wire mesh working so teh graph can be drawn as a mesh of connectect points, rather than a surfave. The rotations have also been set to constantly change over time. The mapping of all the different commands onto the buttons of the wand has been worked out with all three rotations, swapping to and from wireframe, and resetting all having their own buttons on the wand. The current mapping is such that the rotations in the XW, YW, and ZW planes are toggled with buttons 0, 1, and 2 respectively, button 4 toggles whether the display is a surface or a wireframe, and button 5 resets the view. Button 3 does nothing. The code has been run in the Cube.

Image of the current version of the code, showing the function w^2 = v^3

One of the features that is currently only partially implemented is the axes. I plan to have colored lines display the rotated axes to make the transformations more easily visible to the user. X will be red, Y will be green, Z will be blue and W will be white. All 4 are currently in the code, but only the X axis rotates succesfully despite the fact that they all should according to the code. This also means that the W axis isn't actually ever displayed. The last thing from the design that still needs implementing is a menu system controlled with a billboard so the user is able to alter the function that is displayed while the program is running.


The premise for this project is based on a paper written by Thomas Banchoff and Davide P. Cervone for Communications in Visual Mathematics. The purpose of the paper is to explain the visualization of C2 space by representing them in R4 space, exploring both rectangular and polar coordinates.

Image from Tom Banchoff's project, url: