
3.5 Simple Harmonic Motion - Nature of Code
What is a sine wave? In this video, I demonstrate how to use the sin() function in p5.js to simulate simple harmonic motion. Code: https://thecodingtrain.com/tracks/the-nature-of-code-2/noc/3-angles/5-harmonic-motion
p5.js Web Editor Sketches:
πΉοΈ Basic: https://editor.p5js.org/codingtrain/sketches/Fn1feR81W
πΉοΈ Approximate Time: https://editor.p5js.org/codingtrain/sketches/uGCYH4-PN
πΉοΈ Exact Time Exercise: https://editor.p5js.org/codingtrain/sketches/jp2B-0Wkg
πΉοΈ Main: https://editor.p5js.org/codingtrain/sketches/MfvyVULHT
πΉοΈ Yoyo: https://editor.p5js.org/codingtrain/sketches/qBhVjZ0pn
πΉοΈ 2-Axes Exercise: https://editor.p5js.org/codingtrain/sketches/_ir7-suNG
π₯ Previous video: https://youtu.be/O5wjXoFrau4?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
π₯ Next video: https://youtu.be/JLAc9hMtcxk?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
π₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
Videos:
π₯ The map() function - p5.js Tutorial: https://youtu.be/nicMAoW6u1g
π₯ Lissajous Curve Table: https://youtu.be/--6eyLO78CY
Timestamps:
0:00 Back again!
0:21 Why does a graph of sine look like a wave?
2:14 Let's make a breathing circle
4:24 Amplitude and period
7:12 Can we make the period about one second?
8:13 So what's frequency?
8:51 Let's play with increment
10:00 Map sin to y position
10:53 What will you create?
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
π Website: http://thecodingtrain.com/
πΎ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
π© Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
π‘ GitHub: https://github.com/CodingTrain
π¬ Discord: https://thecodingtrain.com/discord
βͺ Nebula: https://go.nebula.tv/codingtrain
π Membership: http://youtube.com/thecodingtrain/join
π Store: https://standard.tv/codingtrain
ποΈ Twitter: https://twitter.com/thecodingtrain
πΈ Instagram: https://www.instagram.com/the.coding.train/
π₯ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π 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-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new
#forbeginners #javascript #p5js
Other Videos By The Coding Train
2021-03-12 | 4.2: Many Particle Systems (Emitters!) - The Nature of Code |
2021-03-09 | 4.1: Particle System Simulation - The Nature of Code |
2021-03-06 | Coding Train Live! |
2021-03-05 | Guest Conductor: Twirling Tech Goddess |
2021-02-27 | Coding Train Live! |
2021-02-22 | Coding Challenge #160: Spring Forces |
2021-02-20 | Coding Challenge #159: Simple Pendulum Simulation |
2021-02-16 | 3.7: Additive Waves - The Nature of Code |
2021-02-13 | Coding Train Live: Self-Avoiding Walk and Discord bot |
2021-02-12 | 3.6 Graphing Sine Wave - Nature of Code |
2021-02-07 | 3.5 Simple Harmonic Motion - Nature of Code |
2021-02-06 | Coding Train Live! |
2021-02-06 | 3.4 Polar Coordinates - The Nature of Code |
2021-02-02 | 3.3: Angles and Vectors - Nature of Code |
2021-01-29 | 3.2 Angular Motion - Nature of Code |
2021-01-26 | 3.1 Angles and Rotation - Nature of Code |
2021-01-23 | Coding Train Live! |
2021-01-16 | 2021 Choo Choo! |
2021-01-15 | Discord Bots 6: Building a Command Handler |
2021-01-08 | 2021 Choo Choo! |
2020-12-23 | Processing Foundation Holiday Telethon 2020 |