Skip to content

[Feat]: Add "Pi from Collisions" simulation (Galperin's method) #323

@mattqdev

Description

@mattqdev

Describe the feature

The setup:

  • A wall on the left.
  • Block 1 (small, mass = $m$) sitting still.
  • Block 2 (large, mass = $M$) moving left toward Block 1.
  • When $M = 10^{2n} \cdot m$, the total number of collisions (Block 1 hitting Block 2 + Block 1 hitting the wall) perfectly equals the first digits of $\pi$.

Motivation

It is one of the most famous, mind-blowing physics/math crossovers (popularized by social media videos). It beautifully shows how conservation of momentum and energy translates to a circle in phase space. It’s highly visual, perfectly fits the "formula clicking" vibe of the site, and is always a crowd-pleaser for students.

Alternatives considered

No response

Additional context

We just need a counter UI element that tracks totalCollisions. To make it work smoothly at high mass ratios (like $M = 1,000,000 \cdot m$), we might need a sub-stepping loop or a mathematical shortcut so the browser canvas doesn't lag out when processing thousands of collisions per second.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions