Skip to content

Approximation of PI by the Monte Carlo method using Python and Pygame

Notifications You must be signed in to change notification settings

Aegonix/PI-Approximation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Pi Approximation

Approximation of PI by the Monte Carlo method using Python and the Pygame library (Still a work in progress.)

Maths

Setup Diagram

Let's take the radius of the circle as r Therefore each side of the square is 2r

The area of the circle is πr² The area of the square is 4r²

If each of the points in the square and circle were to be filled then,

$$\frac{\pi r^2}{4r^2} = \frac {number \ of \ points \ in \ circle}{number \ of \ points \ in \ square}$$

Through this we get $\pi$ as,

$$\pi = 4 \cdot \frac{number \ of \ points \ in \ circle}{number \ of \ points \ in \ square}

About

Approximation of PI by the Monte Carlo method using Python and Pygame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages