HDTycho / MonteCarlo-PI

Estimating the value of Pi using Monte Carlo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MonteCarlo - PI

Estimate the value of Pi using the Monte Carlo method.

We have a circle enclosed by a square whose sides are equal to the diameter of the circle. Generating a large number of uniformly distributed random points and plot them onto the square (the accuracy of the estimation will increase proportionally to the number points that we generate), we can get the value of PI/4 if we divide the number of points that fall within the circle by the total number of points generated.

Check out a Live Demo of the implementation

This is the Java port of the code.

Feel free to use it if you find it interesting.


May the force be with you

About

Estimating the value of Pi using Monte Carlo

License:Apache License 2.0


Languages

Language:Java 29.7%Language:HTML 28.5%Language:JavaScript 25.8%Language:CSS 16.1%