---
id: "4d-stereographic-projection-turning"
title: "Pole-Safe 4D Stereographic Projection & Discrete-Cell Rotations"
aliases: [4D stereographic ray marching, tesseract stereographic projection, S3 polytope projection]
domain: "geometry"
stage: "geometry"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, mobile-gpu]
year_introduced: 1992
inputs: [sdf, material-params]
outputs: [radiance, depth, normals]
style: "stylized"
dynamic: "dynamic"
cost: "medium"
authority: "Hanson & Heng, 1992"
url: "https://texelatlas.vercel.app/t/4d-stereographic-projection-turning/"
sources_verified_at: "2026-11-30"
---
# Pole-Safe 4D Stereographic Projection & Discrete-Cell Rotations (Hanson & Heng, 1992)

> Projects 4D polytopes living on the unit 3-sphere S3 into 3D space via conformal stereographic projection, using symmetry folding and pole-safe distance bounds so 4D rotations turn cells inside out without tessellation blowups.

## Reach for it when

- visualize 4d polytopes tesseracts or hyperspheres rotating in 3d
- avoid flat orthographic crushing when projecting 4d shapes to 3d
- render smooth inside-out 4d torus turning and Clifford tori animations
- preserve angles and spherical curvature when mapping 4d points to 3d space
- build an interactive 4d geometry explorer with intuitive depth cues

## How it works

A 4D polytope such as a tesseract (`8-cell`) or `24-cell` can be normalized onto the unit 3-sphere `S^3 ⊂ R^4`, turning straight 4D edges into great-circle arcs. Rotating it with an orthogonal `SO(4)` matrix across the six 4D coordinate planes (`XY, XZ, YZ, XW, YW, ZW`) turns inner and outer 3D cells smoothly inside out.

**Stereographic projection** maps `(x, y, z, w) ∈ S^3` from the north pole `(0, 0, 0, 1)` to `R^3` via `p = (x, y, z) / (1 - w)`. Because the map is conformal, great-circle edges arrive in 3D as exact circular arcs or lines. Instead of tessellating arcs that stretch unboundedly near `w → 1`, a **ray-marched SDF** lifts each 3D sample `p` back to `S^3` via `q = (2p, |p|^2 - 1) / (|p|^2 + 1)`, applies the inverse `SO(4)` rotation, and folds coordinates by the polytope's discrete symmetry group, collapsing 32 edges and 16 vertices into a few primitive tests.

A **pole-safe step bound** scales spherical distance by the local inverse Jacobian `(|p|^2 + 1) / 2` and computes chords via squared differences `|a - b|^2` to avoid float32 cancellation.

## When to use it

Choose it when rendering smooth, curved 4D polytopes, Hopf fibrations, or inside-out hypercube animations where exact circular edges and real-time 4D rotations matter.

Prefer [sphere-tracing](sphere-tracing) on standard 3D Euclidean SDFs when no non-Euclidean projection distortion is needed. Prefer explicit 4D-to-3D perspective wireframes or sliced cross-section meshes when you need rasterized triangle geometry or physical 3D-printable models.

## Cost

medium — Full-screen per-pixel ray marching with symmetry-folded inverse stereographic SDF evaluation typically runs in 1–3 ms at 1080p on mid-range desktop GPUs, scaling with pixel count and march iterations.

## Failure modes

- Geometry passing directly through the projection pole (w → 1) expands toward infinity, requiring pole-safe clamping or discrete-cell rotation framing to avoid screen-filling tubes
- Evaluating chord distances via 2 - 2*cos(theta) suffers catastrophic float32 cancellation on distant thin arcs unless rewritten as sums of squared differences
- Conformal scale inflation causes Euclidean step sizes to overshoot far from the origin if the inverse Jacobian factor is omitted
- Inside-out turning can invert visual depth cues unless shading, ambient occlusion, or color gradients distinguish W-depth

## Dataflow

- Inputs: sdf, material-params
- Outputs: radiance, depth, normals
- Platforms: webgl2, webgpu, desktop-gpu, mobile-gpu

## Combines with

- [Sphere Tracing](https://texelatlas.vercel.app/t/sphere-tracing.md): Advances camera rays through the inverse-stereographic Jacobian-bounded SDF to render exact curved 4D arcs without mesh subdivision.
- [SDF Modeling: CSG and Smooth Minimum](https://texelatlas.vercel.app/t/sdf-csg-smooth-min.md): Smoothly joins projected 4D vertices, metaballs, or fractal joints onto the circular edge arcs.

## Sources

1. [primary] Andrew J. Hanson, Pheng A. Heng (1992) Illuminating the fourth dimension. IEEE Computer Graphics and Applications. https://doi.org/10.1109/38.144827 (verified via crossref on 2026-11-30)
2. [secondary] A.J. Hanson, P.A. Heng Visualizing the fourth dimension using geometry and light. Proceeding Visualization '91. https://doi.org/10.1109/visual.1991.175821 (verified via doi.org on 2026-11-30)
3. [implementation] acher249 (2026) acher249/codevember-2026. https://github.com/acher249/codevember-2026 License: MIT. (verified via github on 2026-11-30)

## Cite this entry

Texel. "Pole-Safe 4D Stereographic Projection & Discrete-Cell Rotations." https://texelatlas.vercel.app/t/4d-stereographic-projection-turning/ (accessed 2026-12-01).
