This is a simple program that estimate the value of Pi using the Monte Carlo Method that is written totally in Python
From the image above, we can easily calculate the Area of the circle and the square
Therefore, we can simulate this situation by creating a big number of points that are randomly distributed on the image. ALL of the points generated (BOTH blue & red) will represent A_square. The total number of points that are inside the circle (ONLY red) will represent A_circle From there, we can do the calculation and estimate the number pi
I am using pygame for the graphical interface The longer we run the program, the more accurate the output will be
This is how the output looks like: