AdrianButnar / compute-digits-of-pi

Compute digits of Pi by counting the number of elastic collisions between two blocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compute digits of π using elastic collisions

1. Motivation

The whole idea of this project started from this awesome 3Blue1Brown youtube video . He has a wonderful channel and 3 videos presenting how elastic collisions can relate to the notion of phase(phase diagram) and yield the digits of π. Detailed information can be found in the following paper .

2. Brief description

I will, however, provide a short explanation about the parameters involved in this simulation and how the dynamics of the system evolves.

The experiment involves two blocks set on a frictionless surface (μ = 0), having a wall on the left side. The leftmost block has initial velocity v1 = 0, while the other block has an initial speed v2 > 0, oriented towards the first one.

Because of the lack of friction, both the kinetic energy and the momentum will be conserved, more specifically:

and


allowing us to determine the speed of each block after impact:




The key point is setting the mass of the right block to be 100n times the mass of the left block. The reasons behind this are related to the notion of phase (phase diagrams) and the approximation of small angles with the angles themselves, in this case arctan(x) ≈ x.

For further technical details, please do check the valuable resources mentioned above.

P.s.: As today is March 14, happy π day!

Update: A hosted version can be found here.

About

Compute digits of Pi by counting the number of elastic collisions between two blocks


Languages

Language:JavaScript 85.4%Language:CSS 9.7%Language:HTML 5.0%