https://github.com/programerr01/pi
calculating the value of pi
https://github.com/programerr01/pi
Last synced: 9 months ago
JSON representation
calculating the value of pi
- Host: GitHub
- URL: https://github.com/programerr01/pi
- Owner: programerr01
- Created: 2020-03-23T14:10:34.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-23T15:03:53.000Z (about 6 years ago)
- Last Synced: 2025-04-05T15:11:28.521Z (about 1 year ago)
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PI
calculating the value of pi
# Background
pi is the ratio of perimeter of the circle to the diameter
# Basic technique used
let a square whose side is 2r where r is 1
let a circle inside the square whose radius is r
the area of square is a^2 so a =2r
the area of circle is pi*r^2
so the ratio of area of circle divided by the area of square
= pi*r^2 / 4r^2
so the ratio is pi/4
similarly if we take the random point in the whole plane the
probability that the point will land inside the circle is
= points land in circle / total number of points thrown
this ratio should also equal to the ratio of area
pi/4 = total number in circle / total number of points
pi = 4 * total number in circle / total number of points