Hyperbolic Poincaré disk

I wanted to see if live HTML cards can live inside a non-Euclidean Poincaré disk, bend along circular geodesics under real-time Möbius drag transforms, and stay clickable and focusable through local-Jacobian updateElementGeometry() matrices. Drag the disk to shift hyperbolic space, tap any outer card or press Tab to glide it to the centre, and tick the hit-box overlay to compare the linear tangent box against the curved card edges.

Poincaré Disk z = 0.00
origin heptagon
Tiling Glow r = 0.79
0 deg ring
Checklist r = 0.79
2/2 ticked
Scratchpad r = 0.79
editable input
Wave Dial r = 0.79
Step 5/10
range + button
Shader Switches r = 0.79
2/2 on
Signal Counter r = 0.79
07
adjacent hits
Field Log r = 0.79
ready
{7, 4} neighbour
Drag the disk or press Tab to move through the eight cards.
Show the code Möbius isometries, exact inverse GLSL shader, Jacobian hit boxes and geodesic focus glide
  1. Eight live cards inside one drawable canvas. Each card holds standard HTML controls (inputs, checkboxes, range sliders and buttons) with drawable set.
  2. Complex Möbius arithmetic and card composition. Combines the view isometry with each card's home translation into one map M_k(z) and its local derivative M_k'(0).
  3. Exact inverse Möbius fragment shader. Evaluates M_k^{-1}(w) per pixel so straight card borders curve into true circular geodesic arcs without mesh faceting.
  4. Local-Jacobian hit boxes. Converts M_k'(0) into a conformal scale, rotation and translation DOMMatrix for updateElementGeometry(), and measures the corner curvature error.
  5. Geodesic focus glide. Moves a focused or tapped card along a diameter in hyperbolic distance atanh(|w|) while unwinding Thomas-Wigner rotation back to upright.

How it works

Everything on the disk runs inside one WebGL 2 context created through new ElementGL(canvas, ...) from /lib/element-gl.js. On each paint event, the eight live cards upload into their textures with gl.texElementSubImage2D(). I then save ElementGL's active program and vertex array object, draw the circular Poincaré disk and its {7, 4} hyperbolic heptagon tiling via iterative circle reflections in GLSL, restore ElementGL's bindings, and draw the eight cards back-to-front.

Card 0 sits at the origin z = 0 and cards 1 to 7 sit at the exact centres of the seven neighbouring heptagons at radius r = 1 / cx (about 0.790). Each card has a home translation H_k(z) = (z + c_k) / (1 + conj(c_k) * z). Dragging from disk point p_0 to p_1 updates the view isometry with T_{-p_1} o T_{p_0} o V_0, so the point under your pointer stays locked to your finger across the whole disk. Composing the view with H_k collapses into one Möbius map M_k(z) = u_k (z - a_k) / (1 - conj(a_k) * z). The fragment shader evaluates M_k^{-1}(w) directly at every pixel, so card edges curve into circular arcs near the horizon instead of showing polygon facets.

canvas.updateElementGeometry() takes a linear DOMMatrix, so it can't bend a hit box into a circular arc. Instead, I linearise M_k at each card's centre using its complex derivative M_k'(0) = u_k (1 - |w_k|^2). That derivative is purely conformal (a uniform scale 1 - |w_k|^2 and rotation arg(u_k) with no shear), which maps directly to a DOMMatrix scaled by geometryUnit() from /lib/surface.js. Whenever a card's transform key changes, I toggle dataset.hitTick so Chromium flushes its hit-test cache without causing an idle paint loop. Turn on "Show hit-box tangent approximation" to see the linear box hug the centred card and diverge at the four corners near the rim.

Pressing Tab moves browser focus into any of the eight cards inside the canvas. A focusin listener starts a geodesic Möbius glide (skipping animation when prefers-reduced-motion: reduce is set) that brings the focused card straight to z = 0 upright, where the conformal scale is 1.0 and the Jacobian hit box matches the rendered card with zero curvature error.

Live checks

These checks build their own fixtures on testStage() and wait for a tap so loading the page never opens extra WebGL contexts or moves focus.

StatusCheckResult

Findings