A hypercube in D dimensions has 2D vertices, each a string of ±1 coordinates. Every pair of vertices differing in exactly one coordinate is an edge — so the object is rigid and every edge has the same true length in its native space.
for k = D..4:
scale = dist / (dist - x[k])
x[0..k-1] *= scale // one axis collapses per step
Rendering can only show 3 axes at once, so each extra dimension is removed one at a time with a perspective projection: coordinates closer to the "viewer" along the collapsing axis get pushed outward, farther ones get pulled in — exactly like a camera lens. Repeating that from D dimensions down to 3 is dimension collapse.
- Source dimensions — how many axes the hypercube actually has before any collapsing starts.
- Rotation speed — spins the shape through the extra-dimensional planes so the collapse keeps re-revealing new faces.
- Projection distance — how close the "viewer" sits to the object along each collapsing axis; smaller values collapse harder and distort more.
Edge-length stress is the coefficient of variation of the projected edge lengths — 0 means every edge still looks equal (little distortion), higher means the collapse is visibly stretching and squashing the shape, the same loss of fidelity dimensionality-reduction techniques like PCA and t-SNE accept in exchange for a plot a human can actually look at.