An open API service indexing awesome lists of open source software.

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

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]
```
![Pi_30K](https://user-images.githubusercontent.com/50596493/183262594-b2d4615c-7607-4ae2-b7c8-9a1e4b41b201.gif)