Wugi's hoom Wugi's QBasics
QBasic gecodeerd gepeins - Qbasics in codex   

Guido "Wugi" Wuyts @ Dilbeek, Belgium, Europe, World, Solar System, Milky Way, Local Cluster, ...

@ 3 Taalzaak
@ 2 Denkzaak
@ 1 Smaakzaak
@ 0 Wugi's hoom
Relatieve tijd
Font & script
O, redactie
Readers' Indigest
...Complex :  

Complex Functions  Y = Y(X) 

rendered as 4D objects in 2D projections

*** NEW 2016 ***   Other 4D tools and visuals
...*** NiEuW 2017 ! ***   Wugi's Youtube Videos

...references on the net

Wiskunde Maths

2D weergave van 4D objecten beantwoordend aan complexe functies Y=F(X) ****** 2D rendering of 4D objects representing complex functions Y=F(X)

A Complex Function Y = Y(X), or its  real equivalent (y1, y2) = F(x1, x2), may be rendered by a 2D object, or surface, in a 4D space.
This not being accessible to our seeing, it may in turn be reduced to a 3D projection, even a 2D projection. That's what this program does, mainly for some quadratic functions ("conics") but also for some others.
This page shows snapshots and animation for some of them. See explanatory intro and some menus in Complex intro.pps
I 'discovered' this description of complex space back in highschool, when unsatisfied with the there treatment of 'complex coordinates' and the absurd theorems about 'isotropic straight lines' (being perpendicular to themselves and having distance zero among their points). My then teacher was amazed with my first tentative descriptions and drawings of 3D parametric lines belonging to such objects. My later university prof, typically for math wizzes, didn't deem the topic worth much bothering about. However, I was already given  Banchoff as a reference back in 1979 !
See some examples of my first complete drawings (after tentative sketching and with the help of little HP calculator programs:-), and an Amigabasic screenshot in Complex past.pps
By now there is quite some material available on the web, on graphic rendering of complex space. See for instance some examples in complex net.pps.   However, I still miss the basic approach and picturing you'll find here: if there exist similar pages I'll be glad to receive reference at them !

QBasic: description of
complex.bas, complex.exe

***NEW 2016***   Other tools 1

***NEW 2016***   Other tools 2.1

***NEW 2016***   Other tools 2.2

Most menu items in the program should be clear by themselves. You pick a figure and a rotation, and a pseudoanimation will be shown. However, as this program dates back from Amigabasic (!) where each image would need a painstaking minute or so to build,  the sole "animation" effect,  the default number of steps for a 360 rotation is but 9. You should first increase this in the menu Preferences>More>Number of images. Also, the line scanning option in the menu  Preferences>Parameter curves,  helpful after the slow buildup in the early systems, is now outdated (or should be re-tuned...).

Click pictures below to show full size, Animate for an animated GIF

Only recently, ie 2016, I discovered this nice free smartphone app:
Math Grapher 3D

Using the projection trick
X = x1 + A y1 + B y2
Y = x2 + C y1 + D y2
Z = E y1 + F y2
with coefficients A...F corresponding with projection angles of y1 and y2 axes onto the XYZ system,
this app is able to render some of the complex functions considered here.

It produces some nice results, amazing for a smartphone tool.

See the graphs in this column.

The smartphone app having its limitations, eg, with entering long or repetitive formulas, I went looking further. So, more recently even,
I discovered a tool that has been there already for a number of years, witness it being host of the first of the references on the net down this page, since at least 2008 (!) ...
It's called the
and has proved to be a powerful tool, and easy to learn and use.
A free Viewer can be downloaded there.

See the corresponding graphs in this column for each object. The animations are even more impressive, but due to limited storage capacity I cannot upload them to my site *. So, downloading the Grapher files (they are actually text files name.gcf) and installing the free Viewer you will be able to open and explore them that way!

* I made some animation videos using AVS4YOU screen capture,
and uploaded them to YouTube. The ones available have an active link mentioned below...

Only after rethinking the 3D graphics of the adjoining column, I realised it must also be possible to use the same Graphing Calculator 4.0 to make a 2D representation similar to the QBasic pictures.

The results are in this column, to be  compared with the leftmost column.

(Bye bye QBasic ?;-)

Download 2D grapher files with diverse animated rotations (1 zip file) here.
X2 + Y2 = R2   or   Y = 1/X
Circle - Hyperbola        
Notice the equivalence of the circle and hyperbola equations, representing a same object otherwise oriented; the asymptotic planes (here X=0 and Y=0); and the presence of both circle and hyperbola curves on this object.

Plot circ-hypb.png

Grapher file ; Youtube link

graph Circl-Hyp.png

graph Circl-Hyp.png

Parabola Y = X2


A 4D paraboloid.

Plot Parab.png

Grapher file ; Youtube link

graph Parab.png

graph parab 2D.png

Y = eX
Progressive rotation of an exponential curve resulting in an asymptotic blade X=0, and a screw-form blade. The function is periodic, this is one period, repeating itself along the imaginary X-axis.

Plot expon.png

Grapher file ; Youtube link

graph Expon.png

graph Circl-Hyp.png
Y = cos X


The exponential and its reverse combine, their asymptot blades disappear resulting in a double screw, where both meet appears the (co)sine curve. The hyperbolic sine and cosine are typical scan curves of the double blade.

Plot Cosin.png

Grapher file ; Youtube link

graph Cos.png

graph Circl-Hyp.png

 Y = cosec X
A half period of the function, with a half cosec curve in the real plane, and bordered by the asymptotic planes Y=0 and X=0, by cosech curves at one side, and a sech curve at the other.

Grapher file ; Youtube link

graph Cosec.png

graph Circl-Hyp.png
Tan   Y = tan X
A half period of the function, with a half tan curve in the real plane, and bordered by the asymptotic planes Y=0 and X=0, by cotanh curves at one side, and a tanh curve at the other.
(A less 'fluid' animation here, as this item causes an overflow bug for some rotation/step choices in the qb-program:-)

Grapher file ; Youtube link

graph Tan.png

graph Circl-Hyp.png
Double Hyperbola Y = 1/X2
Double Hyperbola         
A "square" Circle-Hyperbola, with a double bladed asymptot Y=0, a "squared" hyperbola in the real plane and a minimal closed centre curve somewhat like a doublewinding circle.

Plot Dble-Hypb.png

graph Circl-Hyp.png

***NEW 2016***   functions of 4 variables (5D)

The following came up as an extension of my "Complex Functions in 4D" topic, so they belong here as well.

An idea I got after reading Quora question

This function, z = z(x,y,u,v), concerns 5 parameters, that means, a 5D graph of a 4D manifold.
So, generally, that would count as not 'vizualizable'.

I proposed, however, juxtaposing two 3D graphs, by keeping  parameters constant pair-wise. That way we'd get
fig 1: u=c, v=d; z = z(x,y,c,d), and
fig 2: x=a, y=b; z = z(a,b,u,v)
Then let the "constants" a,b vary [Slider values !] along the x,y range, and fig 2 evolve with them;
likewise, let c,d, "Slider" along the u,v range, and fig 1 evolve with them.

This is perfectly possible with the Graphing Calculator 4.0.
The Graphing Calculator uses parameters xyz and x'y'z' for twin graphs. So one should keep in mind z' = z; x'=u and y'=v.

*****     *****     *****     *****     *****     *****

Next, I realised that the same method can be applied to two other "pairs of pairs of variables viz. constants":
z = z(x,b,u,d) and z(a,y,c,v), and
z = z(x,b,c,v) and z(a,y,u,d)
Initially I achieved this by creating two more "twin" grapher files, swapping the function variables and constants accordingly in the formulae.
Conclusion: This function is vizualized with three coupled twin graphs!
The drawback of this method is that each "constant" a,b,c,d occurs in the three twin graphs, but cannot be manipulated simultaneously to observe its "triple" effect.

What is needed really, is a set of 6 graphs synchronised by a single set of 4 slider values. Unfortunately Graphing Calculator does not allow multiple graphs beyond 2. So I thought up a trick to at least have a demo of what I would like to see: by off-setting the z function values for the two remaining pairs with a z0 value (z0 = 3 in my demo), so whereas the first pair remains at z = z + 0, the second pair is displayed at z + z0, and the third at z - z0. That way I managed to accommodate three graph pairs in one display pair.
Of course there is always a risk of overlap with this system. So what I would be glad to see is grapher software that can handle multiple graphs, each
independent but capable of being monitored by common parameters such as sliders.
! If you know of one, better yet, if you feel li
ke translating this method into it, please let me know ! ;-)

The grapher files are useable as is.

The only things to change are: redefine the function z(x,y,u,v) and the ranges that one wants vizualized.

Pair of coupled functions and constants.
In (x,y,z) : function z(x,y,c,d) and constants (a,b,0)
In (x',y',z') : function z(a,b,u,v) and constants (c,d,0)

Grapher file1 , Youtube link

Similar pairs for
z(x,b,u,d) & (a,c,0), and z(a,y,c,v) & (b,d,0)
z(x,b,c,v) & (a,d,0), and z(a,y,u,d) & (b,c,0).

Grapher file2 , Grapher file3

graph Circl-Hyp.png    

*****     *****     *****     *****     *****     *****

3 Pairs of coupled functions and constants.
In (x,y,z) : (offset values +/- z0 = 3)
function z(x,y,c,d) and constants (a,b,0)
function z(x,b,u,d) + z0 and constants (a,c,z0)
function z(x,b,c,v) - z0 and constants (a,d,-z0)

In (x',y',z') : (ditto offset)
function z(a,b,u,v) and constants (c,d,0)
function z(a,y,c,v) + z0 and constants (b,d,z0)
function z(a,y,u,d) - z0 and constants (b,c,-z0)

Grapher file ; Youtube link

5D function 6 graphs

***NEW 2016***  Clifford Torus (...)


The Clifford Torus is often represented by its 3D stereographic projection torus, actually a "skew" torus or Cyclide, see e.g.
wikipedia : Clifford_torus and
https://www.youtube.com/watch?v=8oZhO9asPxI .
Sometimes the "real" 4D torus is shown, see e.g.
https://www.youtube.com/watch?v=oVryLr9rm8E .

The Clifford torus evolves in 4D space: (x,y,u,v).
The Clifford torus' 
coordinates satisfy initially xx+yy=1, and uu+vv=1, so their sum=2. In other words, it resides (also when rotated) within the 3D shell of the hypersphere, or "3-Sphere", with radius r = SQRT(2).

The Clifford Torus being a 4D beast, it is often represented by a 3D projection. This is done, e.g., from the v axis point on the 3-Sphere, i.e. v = SQRT(2), toward the 3D space (x,y,u).
Depending on the torus' rotational position (always within its 3-Sphere), its 3D projection Cyclide however varies from a symmetrical torus onward, to an ever more skew one, to become an infinitely opened surface and, beyond, reverse to a torus but in inversed form... before starting another half such cycle, to return to its initial form.

I wanted to show both objects, the projected and its projection, "in the same picture".  Due to the overall 4D-in-2D rendering, both objects overlap in this animation, whereas in 4D space they wouldn't.

The first grapher file and video show this combination.
The (x,y,u) axes are shown in magenta, the v axis in white, since the latter is used as the projection origin towards 3D space (x,y,u). One may occasionally observe the projective correspondency of the white v-axis' extremity with the Torus' and its projective Cyclide's positions, in their extremities...

The second grapher file and video show the Clifford Torus only, now rotating in its 4D space (x,y,u,v), successively along the 6 planes (u,v) - (x,u) - (x,v) - etc.

The music is "Fraktet" - see under my
Though dating from bygone times (when I was young:-) I discovered only recently that it is actuelly a
"Thue-Morse sequence", fractally elongated in 3 voices. The form is indeed a repeated theme AB-BA ... ABBA-BAAB ... ABBABAAB-BAABABBA, etc...
See also wikipedia : Thue-Morse_sequence .

A sequel.

Thinking about the 3-Sphere and the special position of the Clifford Torus in it, I then realised that a whole family of toruses exists, which moreover fills up the 3D space of that 3-Sphere.
These toruses have equations
xx + yy = rr and uu + vv = 2 - rr
The overall sum remains 2, so the embedding in the 3-Sphere is maintained.
The x,y circles vary their radius from 0 to SQRT(2), when the u,v circles do theirs from SQRT(2) to 0. They "meet halfway" with both values = 1, i.e. the Clifford Torus.

I wanted to visualise this feature too, once again with the "4D torus" only, and with 4D torus and 3D Cyclide joint.
So, these are the third and the fourth grapher files and videos...

Final remarks.

I had the impression that I had thought up some unpublished graphic material on the Clifford and other 3-Sphere toruses, but then I stumbled into this:
(see the projections... :-o)

Anyway, (...)

The 4D Clifford Torus and its 3D projection Cyclide :

Grapher file1 , Youtube link1

Clifford Torus     Clifford Torus

Clifford Torus     Clifford Torus

The Clifford Torus rotating in 4D :

Grapher file2  , Youtube link2

Clifford Torus

Visiting the 3-Sphere with 4D Toruses (and their Cyclides) :

Grapher file3  , Youtube link3

Clifford torus     Clifford torus     Clifford torus

Visiting the 3-Sphere with 4D Toruses :

Grapher file4  , Youtube link4

                  torus     Clifford torus     Clifford

***NEW 2016***  (...) and the 3-Sphere itself

I just found this well done recent video on the 3-Sphere, however without mention of the Clifford Torus (in French):


It inspired me to these torus-less approaches to visualise the 3-Sphere itself:

1) one by letting a sphere evolve through it along a diameter, growing and shrinking as it marries the 3-sphere's "border", in the same way that, in 3D, a circle would marry a sphere's border while sliding through it; and

2) one by letting a sphere rotate within a 3-sphere of the same diameter, in the same way that, in 3D, a circle would rotate within a sphere of the same diameter.
! except that this being a 4D case, the plane of rotation of the sphere would rotate, not around an axis as in 3D, but around 2 independent axes, both perpendicular to the plane of rotation, or in other words, around the plane of axes perpendicular to it. (Notice that the sphere, while rotating along the plane of u- and v-axes,  has fixed rotation points on the x- and y-axes).

(...) I hope you enjoy 4D as much as I do !

1) By translation of spheres     Grapher file1 4D  , Grapher file1 3D  , Youtube link1

                  visualisations     3-Sphere

2) By rotation of a sphere     Grapher file2 4D  , Grapher file2 3D  , Youtube link2

                  visualisations     3-Sphere

References on the net

Complex Functions :

24 Views of the Complex Exponential Function see   complex net.pps
"complex functions"+4D - Google zoeken Google lookup
The Complex Exponential and Complex Logarithm see   complex net.pps
Robert_Liebo_Final.pdf (application/pdf Object) see   complex net.pps
meshview 4Dim figures see   complex net.pps
banchoff: On-Line Mathematics some beyond the third dimension
Thomas Banchoff's Home Page a start page
Websites related to "Visual Complex Analysis" a little portal
Vis96-Contour_Meshing.pdf (application/pdf Object) see   complex net.pps
Thinking Like a Mathematician talking about a book on complex space and its 50 or 60 pictures, but no pictures
Dr William T. Shaw "Complex Analysis with Mathematica"
Davide P. Cervone (CV/Art): Exponential Tetraview referenced by Th. Banchoff's page
Tetraview - Wikipedia, the free encyclopedia referenced by Th. Banchoff's page
exp z -4D see   complex net.pps
sitov_sergei.pdf   see fig 4.8 see   complex net.pps

Other 4D visuals :

wikipedia : Clifford_torus The Clifford torus and its 3D Cyclide explained
https://www.youtube.com/watch?v=8oZhO9asPxI A 3D Cyclide
https://www.youtube.com/watch?v=oVryLr9rm8E The 4D Clifford torus itself
wikipedia : Thue-Morse_sequence About the endless and non-periodic abba baab sequence
Is-there-anyway-to-intuitively-visualize-a-function-of-4-variables-in-a-computer-as-in-f-R-4-rightarrow-R? The question of visualising z = z (x,y,u,v)
https://en.wikipedia.org/wiki/Talk:3-sphere Visuals like mine, of the Clifford torus, not withheld for "not understood"
https://www.youtube.com/watch?v=dy_MUfBuq2I The 3-Sphere explained and visualised