Skip to content

Latest commit

 

History

History
10 lines (6 loc) · 546 Bytes

README.md

File metadata and controls

10 lines (6 loc) · 546 Bytes

Approximating-the-Pi

Tested a logic I saw from The Coding Train.

To simplify if you send random particles to a square and if you draw a circle inside of it, the particles that's inside of the circle's division by all particles multiplied by 4 will give us the pi.

Formula Explained:

(pi * r ^ 2) / (4 * r ^ 2) = pi/4 = insideCircleAmount / allParticles then we reach:
pi = 4 * insideCircleAmount / allParticles