<Back> 01/05/2024

Complex Number Visualiser

Social media links: GitHub, Youtube

This is a program to help visualise how complex numbers work in functions and equations. It extensivly uses my graphics library, including the 3D graphics and lighting parts. It has multiple methods for visualising the output, as it would normally require 4 dimensions. The program can also accept multiple input equations for in use as parameteric equations. In 2 equation parametric, the X equation controls the X and Z with the real and imaginary outputs respectivly, and the Y equation mapped to the Y coordinate as usual. In 3 equation parametric, the X, Y and Z equations control the X, Y and Z outputs through the selected mode.

The image shown to the right shows a sample of the output from tan(x), where the X and Z dimensions are real and imaginary numbers respectivly, and the Y is the modulus (magnitude) of the output number (1). Other visual options include: The real component (2); The imaginary component (3); Sum of real and imaginary magnitudes (4); and Argument (angle) of output (5).

The program starts with a terminal, where "Q" exits, "S" selects single equation, "P" selects 2 equation parameteric, "3" selects 3 equation parameteric. Then enter the equations in terms of x for each option, and the window starts with those loaded. A blue unit cube is rendered at the origin for a reference of position and scale.

The control scheme:
Esc - Exit to terminal; WASD, Ctrl, Space - Move; LShift - 4 * speed; RShift - 0.25 * speed; Alt - 10 * speed; Q - 100 * speed; Tab - Toggle full screen; BSP - Rest position and rotation; Shift + M - Toggle lighting material; M - Toggle mouse; V - Cycle through modes; F - Switch wire frame and full rendering; B + =/- - Increase/decrease depth map size; Shift + =/- - Increase/decrease plane size range; =/- - Increase/decrease precision; C - Toggle colour gradient; L - Toggle 3D lighting; R - Auto rotate light source; Shift Scroll - Change render distance; Scroll - Change field of view;

Source code

Download binaries: Windows, Linux


tan(x) in mode 4 with lighting
Parametric sin(x) and tanh(x)cos(x) in mode 1
ln(tanh(x)) in mode 1
4x^3-7x^2+15x-9 in mode 5 with lighting