Visualizations
169 / 500

169 · Math

Borsuk-Ulam Weather

A topology theorem guarantees two antipodes share the weather. Watch them get found.

The Borsuk-Ulam theorem says that at every moment some pair of opposite points on Earth has exactly the same temperature and pressure, because the odd map p to (T(p) - T(-p), P(p) - P(-p)) must vanish. Weather here is drifting Gaussian highs, lows, warm and cold cells over a sun-tilted, land-aware climate, and the globe is drawn from both sides so every point and its antipode are on screen. The fields are sampled on a 3 degree grid that is exactly symmetric under the antipodal map, with triangle diagonals mirrored between hemispheres, so the piecewise linear map stays odd and its zero pairs come in an odd number; each pair is then polished with Newton's method. The amber curve is where temperatures match and the cyan curve where pressures match, and the search is drawn the way the proof goes: a walker follows the amber curve while plotting the pressure difference until it changes sign.

Try it. Pick Warm, Cold, High or Low (or press 1 to 4) and press on either globe to drop a weather cell; hold to strengthen it and drag to move it. Right click paints the opposite. Drag the sky to turn the globes, Space drops a random storm, and R clears your painting. Left alone, storms keep landing near the pair and it has to move.

  • Borsuk-Ulam theorem
  • Piecewise linear zeros
  • Newton's method
  • Contour tracing
  • Orthographic rendering

View the source · one module, plus a small shared runtime for sizing, the animation loop and input

Build your own

Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.

Build an interactive demo of the Borsuk-Ulam theorem with JavaScript and the HTML canvas element: on a globe with made-up weather, find two opposite points with exactly the same temperature and pressure. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.

Start simple:
- Make a canvas that fills the window, stays sharp on high-DPI screens (scale by devicePixelRatio), and resizes with the window. Paint it a dark navy background.
- Define temperature T(p) and pressure P(p) for unit vectors p as a base value plus a few Gaussian bumps on the sphere, a * exp(k * (dot(p, c) - 1)), with random centers, sizes and signed amplitudes.
- Draw an orthographic globe pixel by pixel into an ImageData: for each pixel inside the disk, find the sphere point under it, rotate it by the current spin, and color it by temperature.
- Let f(p) = T(p) - T(-p) and g(p) = P(p) - P(-p). Sample both on a latitude and longitude grid, and draw the curves f = 0 and g = 0 on the globe with marching squares, in two bright colors.
- Where the two curves cross is an answer. Find crossings in grid cells, refine one with a few Newton steps, and pin it and its antipode with markers that show both readings.

Once that works, make it beautiful:
- Draw a second globe seen from behind, so a point and its antipode are always visible, and join the two pins with a dashed arc.
- Let clicks on a globe add warm, cold, high or low cells, and watch the pair jump.
- Add soft lighting and isobars as thin white contours.

Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as making the grid exactly antipodally symmetric so the number of pairs is provably odd, animating a search that walks along the f = 0 curve, or using real temperature data.
PreviousDeep Q SnakeA deep Q-network learns snake from scratch, live, on a retro dot-matrix LCD. NextDrying MudWet clay dries and cracks into a lakebed of curling plates, primaries first.

Related visualizations

  • Road to ChaosMath The logistic map's bifurcations, Mandelbrot bulbs and a cobweb, linked in one picture.
  • Lagrange LandscapePhysics The restricted three-body problem as a plaster relief, Trojans looping on its summits.
  • Inscribed SquaresMath Every closed curve hides a square? Draw one and watch the hunt (open since 1911).
  • Curve ShorteningMath A tangled island shrinks by its own curvature and leaves a topographic map behind.
  • Map ProjectionsMath One procedural planet morphing through a dozen map projections, Tissot ellipses and all.
  • Gas Giant WeatherFluids Real 2D fluid dynamics paints turbulent belts, festoons and oval storms on a gas giant.
  • Standard MapMath Launch orbits of a kicked rotor and paint the road to Hamiltonian chaos in watercolor.
  • Newton BasinsFractals Drag the roots of a polynomial and Newton's method paints a fractal.
  • Kelvin-Helmholtz BillowsFluids A sunset sky where sliding air layers roll a cloud deck into breaking-wave billows.

Use ← and → to move between demos. While the canvas has focus, keys go to the demo instead.

← More from Emergent Mind Labs