Home▸Physics & Mechanics▸Monte Carlo Pi Simulation

🧪 Monte Carlo Pi Simulation

Interactive Monte Carlo estimate of pi: darts in a square or cube, pseudo-random vs Halton vs stratified points, Buffon needles, confidence intervals and repeated-experiment statistics.

Physics & Mechanics2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
Monte Carlo Pi Simulation ↗ Open standalone
⚙ Under the hood

This simulation demonstrates the Monte Carlo method for approximating Pi by generating random points within a square and calculating the ratio of points falling inside a circle inscribed within it. By adjusting parameters like point density, you can observe how these factors affect the accuracy of the Pi estimation. Added a points-per-frame slider that is wired directly into the sampling loop, letting you trade rendering speed for a faster-converging Pi estimate.

Monte CarloPi EstimationRandom Points

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)