Conway's Topograph
Binary Quadratic Form Explorer
This is an interactive visualizer for binary quadratic forms built with Next.js and React. You may explore the Conway topograph, the river, Pell solutions, equivalence of forms, and the Poincaré disc — with a built-in tutorial system covering the theory from the ground up.
Topograph View
- —SVG topograph — BFS-grown trivalent tree with lax vectors placed at superbase barycentres
- —Sign map — faces colored green (positive), red (negative), grey (zero) with live updates as you drag the a, b, c sliders
- —Home triad — the three seed values Q(1,0), Q(0,1), Q(−1,−1) highlighted at the root
- —Vector labels — toggle (p, q) coordinates on every face
- —Depth slider — grow or shrink the tree from depth 1 to 7
- —Animations — directional particles along tree edges and pulse rings on selected nodes (toggle via ⚙ button)
Modes
Two top-level tabs:
| Tab | Description |
|---|---|
| Topograph | Main view with three sub-tabs and layout controls |
| Equivalence | Side-by-side comparison of two forms with a live equivalence check |
Sub-tabs within Topograph:
| Sub-tab | Description |
|---|---|
| Plain | Standard topograph with optional sign coloring |
| River trace | Gold wavy edges mark the river (sign-change boundary); blue gradient lakes highlight zero-value faces |
| Pell solutions | River trace plus amber star glyphs on cells with value 1; dashed arcs connect consecutive solutions; solution list overlaid in the graph corner |
Layout buttons:
| Layout | Description |
|---|---|
| Tree ⊕ | Standard trivalent tree layout |
| Radial ◉ | Circular/radial arrangement of the tree |
| Poincaré disc ◎ | Renders the form within the hyperbolic disc model |
Tutorial System
- —8 pre-built JSON tutorials covering the Conway topograph from first principles
- —Each tutorial step auto-configures the form, depth, mode, and display options
- —Reading mode (full-screen text), activity prompts, and multiple-choice quizzes per step
Things to Try
- —Set a=1, b=0, c=−1 (discriminant 4 > 0) → switch to River trace: a single straight river separates all positive from all negative faces
- —Set a=1, b=2, c=−1 → switch to Pell solutions: find the repeating pattern of cells with value 1; these are solutions to the associated Pell equation x² + 2xy − y² = 1
- —Set a=1, b=0, c=1 (discriminant −4 < 0) → the form is positive-definite: no river, all faces positive
- —Set a=2, b=2, c=−1 → Equivalence mode: compare with a=1, b=0, c=−2; both have discriminant 12 and reduce to the same form
- —Switch to Poincaré disc for any indefinite form and watch the river become a geodesic


