﻿ Four dimensional model display Java model
Home
 This program is a development of one I had on the BBC micro years ago. This one uses the mouse to move the hypercube rather than keyboard keys and has on-screen instructions. I should really write something better about it, what follows is from the BBC micro version but converted to html. The text and graphics were originally in Viewdata format. The BBC micro version was written in about 1985 in 6502 assembler. Much sweat and tears resulted in a speed of about five frames a second. The Acorn Archimedes version which introduced the mouse control was written in C in 1991. A screen dump from the Archimedes version

# Tessera

## Four dimensional cube display

### © Public Domain by David McQuillan

Do you want depth of vision? A four dimensional world has length, breadth, height, and depth. This program lets you control the movement of a four dimensional demon and see what he sees.

The demon continuously stares at a 4 dimensional cube, a hypercube or tesseract, with a hypersphere at each corner.

The image on the back of a demons eye is three dimensional, as opposed to the image on the back of our eyes which is two dimensional. It is this three dimensional image that is shown.

Before launching into the fourth dimension it is worth considering what happens when we look at an ordinary cube with a sphere round each corner.

The image is two dimensional. The nearest point corresponds to the biggest circle which is near to the centre of a ring of smaller circles. A Flatlander, a two dimensional being, could use the picture and the size of the circles to clue himself/herself/itself about 'depth'.

Various views of a cube appear on the next page.

 Flatlander says move up. The central sphere moves down.

If a flatlander controlled us then he could direct us according to the two dimensional image at the back of our eyes, after all that is what we do.

He can say move in the Y direction meaning up, or in the X direction meaning right, or inward which makes the image larger.

It is more convenient (and easier), if instead of the X and Y direction meaning go straight up or down they mean move on the surface of a sphere around the cube keeping a constant distance from it, this is the natural movement if we are always gazing straight at the cube.

We control the demon in a very similar way to how a Flatlander would control us. The demon looks fixedly at a 4-D Cube, a tesseract, with a hypersphere, a 4-dimensional sphere, round each corner.

When the associated program is run the initial view is as looking directly at one corner. The big sphere at the centre is the one nearest to us in 4`D. The are four squashed cubes around the central sphere. For a 3`D cube the central large circle is surrounded by three squashed squares when viewed from a corner.

Pressing various keys causes the demon to move in the X, Y, or Z direction on a hypersphere round the tesseract, or to move in or out. There is also the option to rotate the view or enlarge or reduce the image.

Moving the mouse with a button pressed causes the daemon to move on the sphere round the tesseract, or to move in or out as described in 'Program Control' below.

The tesseract has 16 corners, 32 edges 24 plane faces, and 8 cubes. Only 4 cubes are visible in the initial view as the other 4 are on the 'other' side, there is hidden volume elimination!. There is an option to give a 'wire frame' view where all the corners are visible.

The four dimensions of this program are Euclidean dimensions, nothing like Special Relativity which can have two points separated by zero distance.

## Program Control

Command are given to the demon using the number keys 1 to 9 and 0, and the SHIFT and CTRL keys. Two number keys may be pressed at a time to give a combined effect.

The CTRL key when pressed makes any movement take place in bigger steps so the display is changed faster.

The SHIFT key when pressed has the effect of making a 3`D type movement of the image rather than a 4`D movement. 3`D rotations are 4`D rotations about the line of sight.

Other options allow the colour scheme to be changed, and to switch between a wire frame view or the solid view.

No Shift.4`D Movement
1Move out away, greater depth.
2Move in closer
3Move in X direction
4Move in -ve X direction
5Move in Y direction
6Move in -ve Y direction
7Move in Z direction
8Move in -ve Z direction

Shift
1Make image smaller
2Make image larger

 0 Show wire frame view SHIFT 0 Show view with hidden volume elimination. 9 Change colour scheme. This is followed by four numbers in the range 0..7. These give the actual colour of the background, the two colours mixed (with a little of the background colour) in the hyperspheres, and the edge colour.

To stop the program press BREAK,

## Further Ideas

See if you can draw the sections of a cube as it goes corner first through a plane. A Flatlander would see this if a cube passed through his world. What would a tesseract look like if it went through our world this way?

Could you write a program that drew an accurate picture of a solid cube with a sphere at each corner. You will then see why my representation of a tesseract is not accurate!

How many legs would a hypercat have? Can knots be put into sheets in the fourth dimension?

What is shading like in 4D? I think of it as a haze or a density of transparent colour.

## Epilogue

A black and white version of the program can be run by *X.TESSBW A slow BASIC version showing the logic can be run by CH."X.TESSERA"

Dover Books have a number of softbacks about the fourth dimension including a reprint of the original Edwin Abbott book on Flatland.

The following Pelican books have sections on the subject:

Further Mathematical Diversions
Martin Gardner. Flatland.

Mathematical Carnival, Martin Gardner