Skip to content

erdembircan/monte-carlo-pi-approximation

Repository files navigation

Monte Carlo Pi Approximation

Build and Commit

Live Demo

An interactive visualization of the Monte Carlo method for estimating the value of π.

Random points are scattered uniformly across a unit square. A quarter circle of radius 1 is inscribed in the square. The ratio of points landing inside the quarter circle to the total number of points approximates π/4, giving us:

π = 4 * (points inside circle) / (total points)

As the number of samples increases, the approximation converges toward the true value of π (3.14159...).

Modes

  • Realtime — Points appear one batch at a time with animation. Choose between normal and fast speed.
  • Non-realtime — All points are computed at once in a background thread and rendered when complete.

License

This project is licensed under the Apache License 2.0. See LICENSE for details.

About

Monte Carlo Pi Approximation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors