Explore a tesseract, the four-dimensional analogue of a cube, rotating in 4D and projected into 3D space. Control rotation in the xw, yw and zw planes (and the three 3D planes) and observe its 16 vertices and 32 edges in real time.
| Vertex | x | y | z | w |
|---|
The tesseract. The hypercube is the set [-1,1]4. It has 24 = 16 vertices, 32 edges, 24 square faces and 8 cubic cells; the counts are C(4,k)·24-k and the Euler characteristic V-E+F-C is 0. Its 4-volume is 24 = 16 and the 3-volume of its boundary is 8 cubes x 8 = 64. All of this is checked below from the generated lists.
4D rotation. In 4D a rotation happens in a plane, not about an axis. There are 6 planes (xy, xz, xw, yz, yw, zw). The page stores the 4x4 orthogonal matrix R and advances it with the Cayley transform R ← (I - hA)-1(I + hA) R, h = dt/2, A the skew-symmetric matrix of the six rates: this stays exactly orthogonal and second-order accurate. The Pfaffian β = axyazw - axzayw + axwayz is zero for a simple rotation and non-zero for a double rotation; an isoclinic one (|axy| = |azw|) moves every vertex on a great circle of the same speed (a Clifford / Hopf motion).
Projection. Perspective sends (x,y,z,w) to s·(x,y,z) with s = d/(d - w); orthographic drops w; oblique adds a fixed multiple of w to x,y,z. A tesseract is never "seen" in 4D: what you see is a shadow, so edges that are equal in 4D have unequal lengths on screen, and the "inner cube" is just the w = -1 cell that is farther from the 4D eye. The 2D panels drop two coordinates and divide by a weak perspective factor of each dropped coordinate.
3D slice. Cutting by w = c intersects each of the 32 edges (and each square face in a segment) with the hyperplane. For the unrotated cube and |c| < 1 the section is a cube with 8 vertices; when the cube is rotated it becomes other polyhedra. Integrating the section volume over c recovers 16.
Net. The Dali cross is 8 cubes in 3D: a hub with 6 neighbours and one more cube on a neighbour. Folding rotates each neighbour about the square it shares with its parent, in the plane spanned by the hinge normal and w, through an angle t·90 degrees. All cube edges keep length 2 for every t; at t = 1 the 8 cubes close up into the tesseract (16 distinct vertices).
Simplifications. Faces are drawn as translucent squares without exact depth sorting; edge glow is a halo, not a physical light; the "vertex graph" panel is a rotating 3D drawing of the projected graph, not a graph-layout algorithm. The 4D eye is a mathematical convenience, not a physical camera.