Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Spring Forces

Coding Train via YouTube

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Dive into a 33-minute coding challenge that simulates spring forces using vectors and oscillating motion. Learn how to implement Hooke's Law, create 1D and vector-based springs, add gravity, and control springs with mouse input. Explore particle systems, develop spring and particle classes, and connect multiple particles with springs. Refine the simulation by incorporating shape functions and discover how to create swishy, spring-based animations. Gain practical experience in applying concepts from chapters 2 and 3 of the Nature of Code, with hands-on coding examples in p5.js.

Syllabus

Choo choo!! Springs Coding Challenge!.
Explain! What is Hooke's Law?.
Code! Let's make a 1 dimensional spring!.
Explain! How can we bring in vectors?.
Code! Let's adjust the code to use vectors..
Code! Let's add gravity!.
Code! How can we control the spring with our mouse?.
Explain! But wait!! Particles!.
Copy & Paste! A particle class..
Code! Let's make bob and anchor particles..
Code! We need a spring class..
Debug! What is missing?.
It works!.
Code! But wait!! Particle system!.
Code! Let's connect the particles with springs..
Code! We can refine it a bit..
Code! Playing with beginShape() and endShape()..
Ideas! If you make a swishy robot share it with me!.

Taught by

The Coding Train

Reviews

Start your review of Spring Forces

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.