Computing π Through Physics
Two colliding blocks find π. A rolling body keeps the digits; an imperfect bounce can lose them. Explore the real collision traces, unfold the geometry, then try fields, random pours and a statistical counter on a 3D energy sphere.
Explore connections
Open the application, then follow what changes
Begin with the two-block collision construction for digits of π, then change the geometry and assumptions that make it work. Phase-space views connect counts to an energy circle, while optical equivalents and deliberately biased variants reveal what is invariant and what breaks.
-
01
Count the collisions
Start from the elastic two-block construction and its declared parameters.
-
02
Reveal phase space
Read the same trajectory through energy geometry and unfolding.
-
03
Change the representation
Compare mechanical and optical versions of the underlying construction.
-
04
Break an assumption
Change restitution or support geometry and inspect the resulting bias.
Two blocks, then a rolling body
Two elastic blocks and a wall turn a mass ratio into a collision count. Watch the physical motion beside its mass-weighted momentum trace: energy fixes a circle, while the ratio fixes the angle between two reflection lines. The tally comes from the simulated impacts; the expected answer is a separate reference.
Replace the small block with a rolling body. The no-slip constraint folds rotation into m_eff = m + I/r². Keeping the heavy-to-effective-mass ratio fixed lets a disc, sphere or hoop keep the same digits. That connection between spin and a simple collision counter is the second step of the story.
From a block to a rolling circle, then a piston with an atom that rises and falls: the scene becomes busier, yet the extra motion never feeds back into the along-rail collision law. This is about what can change without changing the answer. The rise-and-fall response is stylized, not a resolved gas simulation.
Then what changes would actually matter?
The turning-point comparison runs the existing collision engines directly. Double launch speed, add rolling inertia while preserving the mass ratio, or lower restitution: compare the recorded momentum states and final impact counts. The distinction is visible before the collection branches out.
Imperfect machines break different assumptions. Restitution changes the bounce, an off-center load changes contact inertia, soft forces replace instantaneous impacts, and gravity acts between them. Each has an ideal limit and an observable source of drift. Loss can lengthen a count; inelastic collapse can destroy termination entirely.
These are controlled experiments, not general rigid-body solvers. For example, the Loaded Disc uses a quasi-static contact-inertia model. A shared interface separates the measured result, reference, bias source and failure state. More sampling does not repair a wrong model.
The wedge was inside the blocks all along
Mass weighting turns the two contact constraints into mirrors separated by α = arctan√(m/M). Draw that wedge in real space and replace the collisions with a ray. Reflect the room instead of the ray: the zig-zag unfolds into a straight line crossing copies of the same wedge.
The opening is constructed from a slope, so π is not put into the input angle. Finite Nα approximates a half-turn; cone and cylinder views refold the same developed path without inventing a separate counting mechanism.
An even simpler geometric interpretation gives another family: polygon perimeters bound the circle from inside and outside, while shape relaxation drives L²/(4A) toward its circular optimum. Length, area, and bounds take over from collision counting.
More dimensions: change what you count
Three blocks with a wall have three coupled velocities. Constant energy gives a sphere cut by several reflection planes, rather than the original one-angle circle. There is no general rule that turns this collision tally into the digits of π. Removing the wall is special: total momentum supplies a second constraint, reducing the free three-body system to a planar circle.
The new optional 3D chamber-area counter uses a different observable. It samples independent velocity directions and counts states in the escape cone: 0 ≤ v₁ ≤ v₂ ≤ v₃. Mass scaling steers samples towards a thin chamber; a solid-angle Jacobian corrects their weights. The chamber’s analytically computed solid angle and weighted hit rate together estimate π.
This is Monte Carlo area measurement, not a claim that the deterministic impact path covers the sphere uniformly. The display keeps the collision experiment separate, reports sampling uncertainty, and remains a statistical estimate rather than an exact digit counter.
A resistor field. A glass of random pours.
A square resistor lattice offers a very different route: solve its voltage field, measure a resistance and compare finite boundary conditions. Saturated signed potential colours and gold current paths make the field solve visible alongside the numerical bracket.
The liquid experiments extend the question to e. In the random-pour glass, a trial ends when uniform random increments first cross unit volume; the mean number of pours approaches e. In the draining vessel, an exponential flow law removes the same fraction in equal times, and changing its exponent makes that e readout drift.
Waves, chaotic maps, random matrices, Buffon crossings and integer sieves remain further routes. Their readouts distinguish exact constructions, statistical uncertainty, finite numerical error and deliberate model bias. The Galton board here uses independent fair branching, providing a useful comparison with Pipeline’s simulated bead contacts.
Recorded examples · 7Geometry behind the numerical experimentCollision portraits, developed surfaces and network fields make the construction inspectable.+
More recorded views · 1
From mechanical sketches to a live collection
The earlier Ruby project explored how collision dynamics encode π, then asked what changes when rotation and additional bodies enter the system. Its phase-space recordings remain a useful record of that investigation.
The current browser collection replaces the earlier exploratory front page. It makes the mechanisms runnable, separates invariance from bias, and extends the question to optics, field solves, oscillators, and statistical estimators. The original visual studies sit here as context for that evolution.

Current scope
- Exact-digit constructions, statistical estimates, model-dependent proxies, and higher-dimensional geometric explorations have different guarantees. Finite count multiplied by its reflection angle approximates π; it is not an exact equality.
- Floating-point arithmetic, integration choices, finite domains, and sample counts limit individual simulations. Several nonideal cases are controlled or quasi-static models rather than general rigid-body simulations.