Skip to content

Using random points in a square with an inner circle to calculate Pi approximately

Notifications You must be signed in to change notification settings

Flogex/MonteCarlo_Piculation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MonteCarlo PiCalculation

Using random points in a square with an inner circle to calculate Pi approximately (see Monte Carlo algorithm).

Description

If you draw a circle inside a square, the diameter is equal to the square's height and width.

Draw Circle intp a square

The fourfold ratio of the area of both shapes equals Pi.

Calculate Pi using ratio of area of circle and square

Parameter

The higher the number of iterations (= number of points in square) the more exact Pi is calculated. Pi as function of iterations

The standard deviation is around 0.001.

About

Using random points in a square with an inner circle to calculate Pi approximately

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published