Uploaded February 2021 | Updated November 2026, 11 hours ago
Choo choo! In this challenge, I build on chapter 3 (Oscillating Motion) of the Nature of Code series and simulate a simple pendulum in p5.js via angular acceleration. thecodingtrain.com/challenges/159-simple-pendulum
πΉοΈ p5.js Simple Pendulum editor.p5js.org/codingtrain/sketches/SN-39sHAC
πΉοΈ p5.js OOP Pendulum: editor.p5js.org/codingtrain/sketches/lJz1cmMp4
πΉοΈ p5.js Pendulum Array: editor.p5js.org/codingtrain/sketches/Bj82tUlIO
π₯ Pendulum Array Exploration: youtu.be/dpqNqyQCcbY?t=2283
π₯ Previous Coding Challenge: youtu.be/3MqJzMvHE3E?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Next Coding Challenge: youtube.com/watch?v=Rr-5HiXquhw&list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ All Coding Challenges: youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Previous Nature of Code Video: youtube.com/watch?v=okfZRl4Xw-c&list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
π₯ Next Nature of Code Video: youtube.com/watch?v=Rr-5HiXquhw&list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
π₯ All Nature of Code Videos: youtube.com/playlist?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
Links discussed in this video:
π Nature of Code Playlist: thecodingtrain.com/learning/nature-of-code/index
π Applications of Differential Equations - The Simple Pendulum: http://calculuslab.deltacollege.edu/ODE/7-A-2/7-A-2-h.html
π Simple Pendulum (myPhysicsLab.com): myphysicslab.com/pendulum/pendulum-en.html
π Object Oriented Simple Pendulum (Nature of Code Book): github.com/nature-of-code/noc-examples-p5.js/tree/master/chp03_oscillation/NOC_3_10_PendulumExampleSimplified
Other videos mentioned in this video:
π₯ Polar Coordinates - Nature of Code: youtu.be/O5wjXoFrau4
π₯ 3.2 Angular Motion - Nature of Code: youtu.be/i2ROE_mAhU0
π₯ Double Pendulum - Coding Challenge #93: youtu.be/uWzPe_S-RVE
π₯ Coding Train Live! (February 6th 2021): youtu.be/dpqNqyQCcbY
Timestamps:
0:00 Choo choo!! 2021 Coding Challenge!
0:43 Code! Drawing a bob and an arm.
1:08 Explain! How are we going to think about this?
2:55 Code! Add our main variables.
3:20 Explain! How do we figure out where the bob is? Trigonometry is the answer!
4:39 Code! Use the polar coordinates formulas we just worked out.
6:30 Code! Let's use angular motion!
7:55 Explain! What is the force of the pendulum? Trigonometry is the answer!
10:46 Code! Add the pendulum force.
12:04 Whoops! Correction on why we multiply by -1.
13:34 Code! Add -1 to the formula.
13:57 Whoops! I figured out some things that I never really understood.
14:24 Code! Correct the 3 step process.
15:32 Something doesn't feel quite right.
16:59 Explain! Angular acceleration relates to the arm length!
18:58 Code! Let's divide by length.
19:54 Code! You could add some damping.
20:21 Ideas! What could you do next?
π Website: thecodingtrain.com
πΎ Share Your Creation! thecodingtrain.com/Guides/community-contribution-guide.html
π© Suggest Topics: github.com/CodingTrain/Rainbow-Topics
π‘ GitHub: github.com/CodingTrain
π¬ Discord: discord.gg/hPuGy2g
π Membership: youtube.com/thecodingtrain/join
π Store: standard.tv/codingtrain
π Books: amazon.com/shop/thecodingtrain
ποΈ Twitter: twitter.com/thecodingtrain
πΈ Instagram: instagram.com/the.coding.train
π₯ Coding Challenges: youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Intro to Programming: youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π p5.js: p5js.org
π p5.js Web Editor: editor.p5js.org
π Processing: processing.org
π Code of Conduct: github.com/CodingTrain/Code-of-Conduct
Choo choo! In this challenge, I build on chapter 3 (Oscillating Motion) of the Nature of Code series and simulate a simple pendulum in p5.js via angular acceleration. thecodingtrain.com/challenges/159-simple-pendulum
πΉοΈ p5.js Simple Pendulum editor.p5js.org/codingtrain/sketches/SN-39sHAC
πΉοΈ p5.js OOP Pendulum: editor.p5js.org/codingtrain/sketches/lJz1cmMp4
πΉοΈ p5.js Pendulum Array: editor.p5js.org/codingtrain/sketches/Bj82tUlIO
π₯ Pendulum Array Exploration: youtu.be/dpqNqyQCcbY?t=2283
π₯ Previous Coding Challenge: youtu.be/3MqJzMvHE3E?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Next Coding Challenge: youtube.com/watch?v=Rr-5HiXquhw&list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ All Coding Challenges: youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Previous Nature of Code Video: youtube.com/watch?v=okfZRl4Xw-c&list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
π₯ Next Nature of Code Video: youtube.com/watch?v=Rr-5HiXquhw&list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
π₯ All Nature of Code Videos: youtube.com/playlist?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
Links discussed in this video:
π Nature of Code Playlist: thecodingtrain.com/learning/nature-of-code/index
π Applications of Differential Equations - The Simple Pendulum: http://calculuslab.deltacollege.edu/ODE/7-A-2/7-A-2-h.html
π Simple Pendulum (myPhysicsLab.com): myphysicslab.com/pendulum/pendulum-en.html
π Object Oriented Simple Pendulum (Nature of Code Book): github.com/nature-of-code/noc-examples-p5.js/tree/master/chp03_oscillation/NOC_3_10_PendulumExampleSimplified
Other videos mentioned in this video:
π₯ Polar Coordinates - Nature of Code: youtu.be/O5wjXoFrau4
π₯ 3.2 Angular Motion - Nature of Code: youtu.be/i2ROE_mAhU0
π₯ Double Pendulum - Coding Challenge #93: youtu.be/uWzPe_S-RVE
π₯ Coding Train Live! (February 6th 2021): youtu.be/dpqNqyQCcbY
Timestamps:
0:00 Choo choo!! 2021 Coding Challenge!
0:43 Code! Drawing a bob and an arm.
1:08 Explain! How are we going to think about this?
2:55 Code! Add our main variables.
3:20 Explain! How do we figure out where the bob is? Trigonometry is the answer!
4:39 Code! Use the polar coordinates formulas we just worked out.
6:30 Code! Let's use angular motion!
7:55 Explain! What is the force of the pendulum? Trigonometry is the answer!
10:46 Code! Add the pendulum force.
12:04 Whoops! Correction on why we multiply by -1.
13:34 Code! Add -1 to the formula.
13:57 Whoops! I figured out some things that I never really understood.
14:24 Code! Correct the 3 step process.
15:32 Something doesn't feel quite right.
16:59 Explain! Angular acceleration relates to the arm length!
18:58 Code! Let's divide by length.
19:54 Code! You could add some damping.
20:21 Ideas! What could you do next?
π Website: thecodingtrain.com
πΎ Share Your Creation! thecodingtrain.com/Guides/community-contribution-guide.html
π© Suggest Topics: github.com/CodingTrain/Rainbow-Topics
π‘ GitHub: github.com/CodingTrain
π¬ Discord: discord.gg/hPuGy2g
π Membership: youtube.com/thecodingtrain/join
π Store: standard.tv/codingtrain
π Books: amazon.com/shop/thecodingtrain
ποΈ Twitter: twitter.com/thecodingtrain
πΈ Instagram: instagram.com/the.coding.train
π₯ Coding Challenges: youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Intro to Programming: youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π p5.js: p5js.org
π p5.js Web Editor: editor.p5js.org
π Processing: processing.org
π Code of Conduct: github.com/CodingTrain/Code-of-Conduct










