Simple Harmonic Motion
Nature of Code Lesson #3.5
What is a sine wave? In this video, I demonstrate how to use the sin() function in p5.js to simulate simple harmonic motion.
Topics
- 0:00 - Back again!
- 0:21 - Explain! Why does a graph of sine look like a wave?
- 2:14 - Code! Let's make a breathing circle
- 4:24 - Explain! Amplitude and period
- 7:12 - Code! Can we make the period about one second?
- 8:13 - Explain! So what's frequency?
- 8:51 - Code! Let's play with increment
- 10:00 - Code! Map sin to y position
- 10:53 - Ideas! What will you create?
Community Contributions
- sin/cos visualisation by LemurDaniel (Source Code)
- spinning balls by LemurDaniel (Source Code)
- Weird_RAINBOW_generator by AbhayKashyap_SimonTiger (Source Code)
- YOYO CRAZINESS!! by AbhayKashyap (Source Code)
You can also add your own version! (See how)
Videos discussed in this lesson
- The map() Function - p5.js Tutorial by The Coding Train
- Lissajous Curve Table - Coding Challenge #116 by The Coding Train