Coding Challenge 95: Approximating the Value of Pi

Описание к видео Coding Challenge 95: Approximating the Value of Pi

In this coding challenge, I use use a "monte carlo" method to approximate the value of Pi in Processing (Java). Code: https://thecodingtrain.com/challenges...

🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/s...

🎥 Previous video:    • Coding Challenge #94: 2048 - Part 1  
🎥 Next video:    • Coding Challenge #96: Visualizing the...  
🎥 All videos:    • Coding Challenges  

References:
🥧 Million Pi Digits: http://www.piday.org/million/

Videos:
🎥 STEMcoding celebrates Pi day!:    • Pi day!  
🚂 Learning Processing:    • Introduction - Processing Tutorial  
🔴 Coding Train Live 126.1:    • Live Stream #126.1: Happy Pi Day! - P...  

Related Coding Challenges:
🚂 #96 Visualizing the Digits of Pi:    • Coding Challenge #96: Visualizing the...  
🚂 #140 Leibniz Formula for Pi:    • Coding Challenge #140: Pi Approximati...  
🚂 #156 Peeking Inside Pi:    • Coding Challenge #156: Peeking inside Pi  
🚂 #161 Estimating π from Random Numbers with Euclid's Algorithm:    • Coding Challenge 161: Estimating π fr...  
🚂 #169 Pi in the Sky Game:    • Coding Challenge 169: Pi in the Sky Game  

Timestamps:
0:00 Approximating PI
0:48 Suggestion from akraus53
1:43 Methodology
7:31 Let's code!
13:30 Determine number of "darts" in the circle
18:20 Casting to doubles to increase precision
22:07 Keep track of current best estimate
26:30 Suggestions and conclusion

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

🚂 Website: http://thecodingtrain.com/
👾 Share Your Creation! https://thecodingtrain.com/guides/pas...
🚩 Suggest Topics: https://github.com/CodingTrain/Sugges...
💡 GitHub: https://github.com/CodingTrain
💬 Discord: https://thecodingtrain.com/discord
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter:   / thecodingtrain  
📸 Instagram:   / the.coding.train  

🎥 Coding Challenges:    • Coding Challenges  
🎥 Intro to Programming:    • Start learning here!  

🔗 p5.js: https://p5js.org
🔗 p5.js Web Editor: https://editor.p5js.org/
🔗 Processing: https://processing.org

📄 Code of Conduct: https://github.com/CodingTrain/Code-o...

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod...

#montecarlo #estimatingpi #processing

Комментарии

Информация по комментариям в разработке