Additive Waves
Nature of Code Lesson #3.7
This video builds on the previous sine wave visualization in p5.js example. Here, I build a Wave class with variables for period, amplitude, and phase, and demonstrate how to add multiple wave patterns together!
Topics
- 0:00 - Welcome back!
- 0:26 - Explain! How do we make a wave class?
- 2:02 - Explain! The formula we'll use for a wave.
- 4:53 - Code! Let's make a wave class.
- 7:33 - Explore! Why did we spend the time to make the wave class?
- 8:08 - Code! Adding waves together!
- 9:39 - Code! Let's animate it!
- 10:40 - Code! A couple small improvements.
- 11:21 - Ideas! I hope you try some of these ideas!
- 11:43 - What's next?
Community Contributions
- ColorFull Sine Wave with some sliders!! by Abhay Kashyap (Source Code)
- lines with some nice looking gradient by FelixCPP (Source Code)
- Fun with Waves by Tim (Source Code)
You can also add your own version! (See how)
Videos discussed in this lesson
- Simple Pendulum Simulation by The Coding Train