loading...
running...
The science
The body. The tesseract (8-cell, hypercube) is the set of points (x,y,z,w) with every coordinate in [-1, 1]. Its 16 vertices are the sign choices (±1,±1,±1,±1); two vertices share an edge when exactly one sign differs (32 edges of length 2). Fixing two coordinates gives a square (24 faces) and fixing one gives a cube (8 cells, two per axis). In general the number of k-faces of the n-cube is C(n,k) 2n-k, and V - E + F - C = 0 for n = 4 (the Euler characteristic of the boundary, a 3-sphere).
Rotations. Four dimensions have six coordinate planes, XY XZ YZ XW YW ZW. A rotation by angle θ in plane (i,j) is the matrix xi' = xi cosθ - xj sinθ, xj' = xi sinθ + xj cosθ The pose is the product ZW · YW · XW · YZ · XZ · XY (XY applied first); because 4D rotations do not commute, that order is a convention and is fixed here. Every rotation matrix is orthogonal with determinant +1, so all 32 edges keep their length 2 and the hypervolume 24 = 16 never changes: only the shadow changes. A general 4D rotation is a double rotation (two independent planes, XY and ZW for instance). When both angles are equal it is isoclinic (Clifford): every point circles at the same speed, and the matrix equals left-multiplication by a unit quaternion, p → q p, q = cosθ + i sinθ.
Projection. A screen can only show 2D, so there are two steps. First 4D to 3D: a perspective projection from an eye on the w axis at distance d, (x,y,z) → (x,y,z) · d / (d - w) (orthographic: just drop w). With the body upright the near cell (w = +1) becomes a cube of edge 2d/(d-1) and the far cell (w = -1) a cube of edge 2d/(d+1): the familiar cube-in-a-cube. The edges look unequal only because of this projection. Second, 3D to 2D: in the 2D page an ordinary perspective camera, in the 3D page a real lamp that casts the 3D shadow onto the screen in the room, so the wall shows the shadow of a shadow.
Orthographic shadow volume. The parallel shadow of the hypercube in 3D is a zonotope generated by the four projected edge vectors ai = 2 (R ei)xyz; its volume is the sum of the generator-triple determinants, which collapses to the closed form V = 8 (|Rw1| + |Rw2| + |Rw3| + |Rw4|), the L1 norm of the w row of R. Since that row is a unit vector, V lies between 8 (a cube) and 16 (a rhombic dodecahedron, reached when every entry is 1/2).
Section. A flat 3D observer sees only the cut of the body by the hyperplane w' = c. The cut meets an edge when its endpoints lie on opposite sides; each crossed edge gives a vertex, each crossed square a segment and each crossed cube a face. The upright body cut at c = 0 is a cube; tilted, it becomes a truncated cube, a hexagonal prism or a tetrahedron-like solid, and always satisfies V - E + F = 2 because it is a convex polyhedron.
Checks. (1) The counts 32 edges, 24 squares and 8 cubes are re-derived by brute force from Hamming distances (4-cycles, 3-regular 8-vertex subgraphs) rather than read from the generator tables, and V-E+F-C = 0. (2) A random six-angle rotation is orthogonal to 1e-15, has det 1, keeps all edges at length 2 and the 4D volume at 16. (3) The Givens product XY(t)ZW(t) is compared with a separately coded quaternion product. (4) At d = 3.2 the two projected cubes have edges 2d/(d-1) and 2d/(d+1). (5) The zonotope triple sum is compared with the closed form. (6) V-E+F = 2 on 40 random orientations and offsets, and the upright cut at c = 0 is a cube. The 3D page adds a seventh: the length of every rendered rod (taken from its instance matrix) against the projected 4D edge.
Simplifications. The motion is pure kinematics (no dynamics). Edges are drawn as rods of constant thickness and faces as translucent additive quads; a real 4D observer would see opaque cells occluding each other, which a 3D screen cannot show. Perspective uses the eye on one fixed axis, so the viewing direction in 4D is always w. The explode control moves each cell along its own 4D normal, which is an illustration of how the eight cubes meet, not a physical process.