This was my attempt in calculating PI using a rather known method discussed by the Youtuber 3Brown1Blue, This method consists of simulating two boxes and a wall colliding, the number of collisions happens to be the number PI.
My simulation is heavily influenced by the video of 3Brown1Blue and uses the same library he uses to create his videos, which lead to learning so much about computer graphics in the process.
This video is showcasing, the calculations of up to 4 digits of PI
The video shows at the top the number of collisions, and if you still remember the number PI which is PI = 3.1415926535..., the two numbers are nearly the same.
This method is not very efficient, but the very fascinating to watch.
For more details and explanation please take a look at 3Brown1Blue's video [ Ссылка ]
Here's the source code: [ Ссылка ]
Ещё видео!