Epic, unnecessary methods to calculate our favorite number! Let's get started, shall we?
involves randomly generating points within a square and determining the ratio of points falling inside a quarter circle inscribed within the square to the total number of points generated. This ratio multiplied by 4 provides an approximation of pi.
is a geometrical probability method used to approximate pi. It involves dropping a needle of length L onto a plane with parallel lines separated by a distance D. By counting the number of times the needle crosses a line in relation to the total number of drops, pi can be estimated.
involves inscribing and circumscribing regular polygons within a circle. By increasing the number of sides of the polygon, a more accurate approximation of pi can be obtained by calculating the perimeter.
is a simulation held in a frictionless environment where conservation of momentum applies. Curiously, the number of collisions between the blocks provides an approximation of pi.
is done by recursively packing smaller and smaller squares into a circle. The area of the squares divided by the radius squared provides an approximation of pi.
is defined by the set of complex numbers c for which a certain function does not diverge. The number of iterations it takes for the function to diverge provides an approximation of pi.
is a geometric drawing that produces mathematical curves. By setting the outer pivot to go pi times faster than the inner pivot, the ratio of the number of rotations of the outer pivot to the inner pivot provides an approximation of pi.
I hoped you enjoyed some pi today 🥧. Visualizations were made with the p5.js library. Feel free to check out the source code on Github by clicking the footer!