/pi-calculator

Calculates pi - leave it running for an increasingly close approximation of pi.

Primary LanguagePython

Pi calculation

Run pi.py to calculate pi. Leave it running to get more accurate results.

How it Works

Repeatedly selects random points in a one-by-one square. There is a one-quarter pi chance that this point will be less than 0.5 in distance from the origin, so by multiplying the fraction of points whithin 0.5 from the origin by 4, an increasingly close value of pi is found.