https://github.com/simonnyvall/finding-pi
Approximating pi with phisics
https://github.com/simonnyvall/finding-pi
c cpp math pi
Last synced: 2 months ago
JSON representation
Approximating pi with phisics
- Host: GitHub
- URL: https://github.com/simonnyvall/finding-pi
- Owner: SimonNyvall
- Created: 2022-06-17T15:37:42.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-06T18:59:17.000Z (almost 4 years ago)
- Last Synced: 2026-03-29T21:02:50.013Z (3 months ago)
- Topics: c, cpp, math, pi
- Language: C++
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Finding PI
A code inspired by a YouTube video
https://www.youtube.com/watch?v=5cNnf_7e92Q&t=392s
## How the algorithm finds pi
Imagine you have a circle inside of a square, where the circle diameter is the same length as the square. Then random points start to be plotting all around the square. When you map the amount of dots that has learnt inside the circle and divide it the total amount, you will get an approximation of pi.
```
4 * [DOTS IN CIRCLE] / [DOTS IN SQUARE] = [PI]
```
