Geometry as motion

Dimensions in Motion

Choose a two-, three- or four-dimensional object and watch it rotate. The page does not ask you to picture four-dimensional space directly. It simply keeps a list of coordinates, turns them a little, and projects the result down to the two-dimensional screen.

Cube

3D object projected onto a 2D screen

A cube has eight corner points. Rotation changes the coordinates of those points; the lines simply reconnect the same corners after each update.

The whole trick

Every object on the screen is stored as points and connections. A point in two dimensions needs two numbers, usually called x and y. A point in three dimensions needs x, y and z. A point in four dimensions needs one more number, which we can call w. Nothing mystical happens when that fourth number is added. The computer just has a longer coordinate list.

1. Store the cornersKeep a list such as (x, y, z) or (x, y, z, w).
2. Turn the coordinatesEach animation frame rotates the numbers by a tiny angle.
3. Flatten for the screenA 4D point is first shown in 3D, then a 3D point is shown in 2D.

Rotation without ceremony

To rotate a point, we mix two coordinates. For example, in an ordinary flat rotation we mix x and y. If the turn angle is θ, the new numbers are:

x' = x cos(θ) − y sin(θ)
y' = x sin(θ) + y cos(θ)

You do not need to memorise this to understand the animation. It simply says: "take some of the old x, take some of the old y, and combine them so that distance from the centre stays the same". In three dimensions we can rotate in the xy, xz or yz planes. In four dimensions there are more possible pairs, such as xw and zw. The animation uses several of these at once so that the higher-dimensional structure changes visibly rather than merely spinning like a flat picture.

How a four-dimensional object reaches a flat monitor

A four-dimensional object cannot be placed literally on a two-dimensional screen. Instead we draw a projection. This is the same general idea by which a three-dimensional cube becomes a perspective drawing on paper.

4D point → 3D projected point → 2D screen point

The projection makes points farther away appear closer together. For a 4D point, the w coordinate controls how strongly its 3D image is scaled. Then the ordinary z coordinate controls the final 2D perspective. A tesseract therefore appears as a changing family of nested cubes and connecting edges. That is not the tesseract itself. It is the tesseract's moving shadow, mathematically speaking.

Why the lines know where to go

The edges are defined before the animation begins. If two vertices are neighbours in the original object, they remain neighbours after every rotation. The program does not guess where to draw a line. It transforms all the vertices, projects them, then reconnects the same pairs.

For a tesseract this is particularly neat. Its sixteen vertices can be written using every possible choice of +1 or −1 for four coordinates. Two vertices are joined when they differ in exactly one coordinate. The rule is simple even though the resulting object is four-dimensional.

What you are really looking at

The display is an exercise in changing coordinates, not in asking the eye to perform the impossible. Two dimensions are drawn directly. Three dimensions are projected once. Four dimensions are projected twice. The apparent complexity comes from repetition: many simple points, many simple rotations, and the same projection rule applied again and again.