Skip to content
Bruteforcing to derive π
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
mathecarlo
LICENSE
README.md
mc demo.gif

README.md

mathecarlo

Bruteforcing to derive π

image

How?

  • Creating a canvas - with a square, and a circle that fully fills the square
  • Plotting a point with randomly generated co-ordinates.
  • Measuring (through the pythagoras theorem) if the point falls within the circle or not.
  • Getting the ratio of points in the circle, to those generated in total
  • Multiplying the ratio by 4 - to get π
You can’t perform that action at this time.