Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Coding Challenge 176: Buffon's Needle

Автор: The Coding Train

Загружено: 2023-03-14

Просмотров: 108048

Описание:

How do toothpicks approximate the value of pi? I'll show you by coding a simulation in p5.js! Code: https://thecodingtrain.com/challenges...

🚀 Watch this video ad-free on Nebula https://nebula.tv/videos/codingtrain-...

p5.js Web Editor Sketches:
🕹️ Buffon's Needle: https://editor.p5js.org/codingtrain/s...
🕹️ Line Line Intersection: https://editor.p5js.org/codingtrain/s...
🕹️ Probability Density Function Graph: https://editor.p5js.org/codingtrain/s...

🎥 Previous video:    • Coding Challenge: 3D on Apple II  
🎥 All videos:    • Coding Challenges  

References:
🔗 Buffon's Needle: https://en.wikipedia.org/wiki/Buffon%...
🔗 Analysis and Simulation: https://mste.illinois.edu/activity/bu...
🔗 Pickup Sticks & Pi: https://ogden.eu/pi/

Related Coding Challenges:
🚂 95 Approximating the Value of Pi:    • Coding Challenge 95: Approximating the Val...  
🚂 126 Toothpicks:    • Coding Challenge #126: Toothpicks  
🚂 145 Ray Casting 2D:    • Coding Challenge 145: 2D Raycasting  

Timestamps:
0:00 Happy Pi Day 2023!
0:45 Introduce Buffon's Needle
1:40 Unpack the math
4:40 Let toothpick fall at an angle
7:08 The probability that the toothpick crosses the border
7:27 Uniform probability density function
8:12 Illustrate the probability with a graph
10:49 Approximating the value of Pi
11:11 Calculating the area under the curve
12:48 Resources for Buffon's Needle
13:28 Start Coding
13:53 Draw vertical lines
14:20 Add a toothpick
15:02 Draw background in setup
15:57 We have to use the built-in value of Pi
17:00 Find the closest column
17:22 Determine if the toothpick intersects the column
18:10 Rotate the line relative to the y-axis
18:50 Draw the toothpick as a vertical line
19:40 Improve the visuals
20:48 Approximate the value of Pi using the probability that a toothpick intersects a column
23:45 Suggestions for variations
24:08 New Passenger Showcase page on the Coding Train website
24:38 Easter egg

Editing by Mathieu Blanchette
Animations by Jason Heglund
Pi Day Song by Will from America
Music from Epidemic Sound

🚂 Website: https://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...

#piday #pi #buffonsneedle #buffon #p5js #javascript

Coding Challenge 176: Buffon's Needle

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Coding Challenge 177: Soft Body Physics

Coding Challenge 177: Soft Body Physics

Coding the Collatz Conjecture

Coding the Collatz Conjecture

Calculating π by hand: the Chudnovsky algorithm

Calculating π by hand: the Chudnovsky algorithm

Why π is in the normal distribution (beyond integral tricks)

Why π is in the normal distribution (beyond integral tricks)

Coding Challenge 178: Climate Spiral

Coding Challenge 178: Climate Spiral

Как выглядит график функции x^a, если a не является целым числом? Необычный взгляд на знакомые фу...

Как выглядит график функции x^a, если a не является целым числом? Необычный взгляд на знакомые фу...

Самые необычные проявления числа Пи в математике | Можете ли вы это объяснить?

Самые необычные проявления числа Пи в математике | Можете ли вы это объяснить?

Программирование с использованием математики | Лямбда-исчисление

Программирование с использованием математики | Лямбда-исчисление

Coding Challenge 184: Collisions Without a Physics Library!

Coding Challenge 184: Collisions Without a Physics Library!

Coding Challenge 165: Slide Puzzle

Coding Challenge 165: Slide Puzzle

Finding pi in a needle-stack

Finding pi in a needle-stack

Surprising π from probability! Buffon's needle problem

Surprising π from probability! Buffon's needle problem

Coding Challenge 182: Apollonian Gasket Fractal

Coding Challenge 182: Apollonian Gasket Fractal

Coding Challenge 144: 2D Black Hole Visualization

Coding Challenge 144: 2D Black Hole Visualization

p5.js Coding Tutorial | Chladni Patterns

p5.js Coding Tutorial | Chladni Patterns

Coding Challenge 180: Falling Sand

Coding Challenge 180: Falling Sand

Calculating Pi Experimentally (Buffon's Needle Problem)

Calculating Pi Experimentally (Buffon's Needle Problem)

Совершенно иной подход к математике [Veritasium]

Совершенно иной подход к математике [Veritasium]

Мозаика Пенроуза, бесконечная и неповторимая [Veritasium]

Мозаика Пенроуза, бесконечная и неповторимая [Veritasium]

Симметрия в искусстве и физике

Симметрия в искусстве и физике

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]