filmov
tv
Coding Challenge 176: Buffon's Needle
![preview_player](https://i.ytimg.com/vi/h5ZNcAPXxew/maxresdefault.jpg)
Показать описание
References:
Related Coding Challenges:
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
#piday #pi #buffonsneedle #buffon #p5js #javascript
Комментарии