4-Polytope · orthographic

Pentachoron

The 5-cell — a regular 4-simplex, tumbling in ℝ⁴, projected to your screen.

vertices5 edges10 faces10 rot · planesYW XW ZW XY angle · rad0.000
click / space — pause · drag — orbit
after artifact.com — rebuilt dependency-free

How it works

A shadow of a four-dimensional object

What you're watching isn't a 3D model spinning. It's a genuinely four-dimensional shape rotating in 4-space, casting a shadow down into our three dimensions — and then onto your flat screen. The morphing you see is that shadow shifting as the object turns in a direction we can't point to.

The shape · a 5-cell

The object is a pentachoron (or 5-cell) — the 4D analogue of the tetrahedron. It's the simplest closed shape in 4D: 5 corner points, with every pair joined by an edge (10 edges) and every triple spanning a triangular face (10 faces). All five points sit an equal distance apart in 4-space.

Turning it in 4D

In four dimensions you don't rotate around an axis — you rotate within a plane, and there are six of them (XY, XZ, XW, YZ, YW, ZW). This animation spins in four at once — YW, XW, ZW, XY — each at a different speed. A turn in the YW-plane, for example, only stirs the y and w coordinates:

# rotate by θ in the YW-plane
y' = y·cos θ − w·sin θ
w' = y·sin θ + w·cos θ   (x, z untouched)

The four speeds are scaled by the golden ratio's conjugate (≈ 0.618…), an irrational number — so the rotations never come back into step and the tumble never exactly repeats.

From 4D to your screen

Two projections, back to back. First we drop the 4th coordinate (w): the 4D shape casts a 3D shadow, exactly the way a 3D object casts a 2D one under a lamp. Then an ordinary three-quarter view flattens that shadow to 2D. Because a rigid turn in 4D becomes a stretching, non-rigid motion once flattened, the outline seems to swell, fold, and turn inside-out — even though the real object is rotating stiffly, never changing shape.

Drawing each frame

Every frame recomputes the five points, sorts the ten faces back-to-front, and paints them as translucent triangles whose colour drifts through the spectrum over time, with the wireframe edges and corner dots layered on top. No 3D engine, no external libraries — just a 2D canvas and a little linear algebra. Drag to add your own tilt, or open controls to reshape it live.

For Marvyn

The animation, stated precisely

Everything below is what the code actually computes, written for someone who speaks Lie groups. Coordinates are (x,y,z,w) on ℝ⁴.

1 · The regular 4-simplex

Five vertices v0,…,v4 ∈ ℝ⁴, the rows of

V= [ 1110 −1−110 −11−10 1−1−10 0005 ].

The first four span a regular tetrahedron in the hyperplane w=0; the fifth is the apex on the w-axis. Centre on the barycentre and set pi=vi−c:

c= 15 ∑i=04 vi = (0,0,0, 55).

The result is regular: all ten pairwise distances agree, and every vertex is equidistant from the centre,

ℓ=‖pi−pj‖ =22 , R=‖pi‖ =45 =ℓ25,

matching the general regular n-simplex relation R=ℓn2(n+1) at n=4.

2 · The motion lives in SO(4)

A simple rotation acts in a coordinate 2-plane ea∧eb, the identity elsewhere. For the yw-plane,

RYW(θ)= [ 1000 0cosθ0−sinθ 0010 0sinθ0cosθ ]=exp(θBYW),

with generator BYW=ewey⊤−eyew⊤∈so(4). The frame orientation is the ordered product

R(t)= RXY(φ2t) RZW(φ2t) RXW(t) RYW(φt) ∈SO(4),

acting on column vectors, so RYW is applied first. Because these generators do not pairwise commute, R(t) is a product of one-parameter subgroups, not itself one.

Structurally so(4)≅so(3)⊕so(3) and SO(4)≅(SU(2)×SU(2))/{±1}. Every element is a double rotation with two invariant orthogonal planes; equivalently Ω=R˙R⊤ splits under Λ2ℝ4=Λ+2⊕Λ−2 into self- and anti-self-dual parts.

3 · Golden frequencies ⇒ quasiperiodicity

With φ=5−12=Φ−1 the defining relation gives

φ2+φ−1=0 ⇒ φ2=1−φ.

The angle vector is a straight line on the torus,

Θ(t)= t·(φ,1,φ2,φ2) ∈T4.

Naively four frequencies — but φ2=1−φ collapses them:

dimℚ spanℚ{1,φ,φ2} =2.

So Θ has exactly two rationally independent frequencies, {1,φ}. By Kronecker–Weyl its orbit closure is a 2-torus on which it equidistributes: the configuration is quasiperiodic, and since φ∉ℚ it is never periodic.

4 · Projection to the screen

Kill the fourth coordinate — orthogonal projection along ew — then take an orthographic three-quarter view P:ℝ3→ℝ2 (optionally after a user tilt T∈SO(3)):

π= [ 1000 0100 0010 ] , P= [ 100 012−12 ].

Each drawn vertex and its painter-sort depth are

qi(t)= PTπR(t)pi di= 12 (y+z).

The shadow map A(t)=πR(t):ℝ4→ℝ3 is a time-varying contraction with singular values σ1≥σ2≥σ3 in [0,1]. The apparent morphing is their oscillation: as a principal axis swings toward ew some σk→ small and the image degenerates — the rigid 4-motion read off a non-rigid 3-shadow.

5 · What gets drawn

The boundary complex ∂Δ4≅S3 has face vector and Euler characteristic

∑k=03 (−1)kfk =5−10+10−5 =0=χ(S3).

The renderer draws the 2-skeleton: all (53)=10 triangular faces, translucent and depth-sorted, with the 1-skeleton and vertices layered on top.