Happy Pi Day! To celebrate I attempt to compute the digits of Pi using the “collisions” method, thanks to 3Blue1Brown for the idea! Code: thecodingtrain.com/challenges...
🕹️ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/s...
🎥 Previous video: • Coding Challenge #138:...
🎥 Next video: • Coding Challenge #140:...
🎥 All videos: • Coding Challenges
References:
📄 Playing Pool with Pi: www.maths.tcd.ie/~lebed/Galpe...
💥 Elastic Collisions: en.wikipedia.org/wiki/Elastic...
📓 Euler Method: en.wikipedia.org/wiki/Euler_m...
🥧 Additional Pi Day Code Examples: github.com/CodingTrain/Pi-Day...
Videos:
👁️🗨️ The Block Collision Puzzle: • The block collision pu...
🔢 Pi and Bouncing Balls: • Pi and Bouncing Balls ...
⭐️ Member-Exclusive Pi Day Prep: • Member Only - Pi Day Prep
🔴 Coding Train Live 172: • Coding Train Live 172:...
Related Coding Challenges:
🚂 #95 Approximating the Value of Pi: • Coding Challenge 95: A...
🚂 #140 Leibniz Formula for Pi: • Coding Challenge #140:...
🚂 #156 Peeking Inside Pi: • Coding Challenge #156:...
🚂 #161 Estimating π from Random Numbers with Euclid's Algorithm: • Coding Challenge 161: ...
🚂 #169 Pi in the Sky Game: • Coding Challenge 169: ...
Timestamps:
0:00 Introduction!
1:51 Basic code of the structure
7:00 Simulating elastic collision between two blocks
12:03 Simulating the wall
13:59 Adding the clack!
14:29 Counting the collisions!
18:09 Adding timesteps to control approximation
24:12 Adding constraints to speed up animation
26:47 Watching collisions upto 11 digits of pi!
28:46 Other methods to simulate elastic collisions and things to try!
30:50 Fake outro (and a special Pi Day song!)
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
🚂 Website: thecodingtrain.com/
👾 Share Your Creation! thecodingtrain.com/guides/pas...
🚩 Suggest Topics: github.com/CodingTrain/Sugges...
💡 GitHub: github.com/CodingTrain
💬 Discord: thecodingtrain.com/discord
💖 Membership: ru-vid.comjoin
🛒 Store: standard.tv/codingtrain
🖋️ Twitter: / thecodingtrain
📸 Instagram: / the.coding.train
🎥 Coding Challenges: • Coding Challenges
🎥 Intro to Programming: • Start learning here!
🔗 p5.js: p5js.org
🔗 p5.js Web Editor: editor.p5js.org/
🔗 Processing: processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
#3blue1brown #elasticcollision #piday #eulermethod #p5js #javascript
28 июн 2024