Coding Challenge #160: Spring Forces

preview_player
Показать описание


Links discussed in this video:

Other videos mentioned in this video:

Timestamps:
0:00 Choo choo!! Springs Coding Challenge!
0:40 Explain! What is Hooke's Law?
2:51 Code! Let's make a 1 dimensional spring!
5:13 Explain! How can we bring in vectors?
7:17 Code! Let's adjust the code to use vectors.
11:57 Code! Let's add gravity!
13:03 Code! How can we control the spring with our mouse?
13:53 Explain! But wait!! Particles!
15:14 Copy & Paste! A particle class.
16:41 Code! Let's make bob and anchor particles.
18:01 Code! We need a spring class.
21:32 Debug! What is missing?
23:16 It works!
24:16 Code! But wait!! Particle system!
25:28 Code! Let's connect the particles with springs.
27:12 Code! We can refine it a bit.
29:29 Code! Playing with beginShape() and endShape().
31:07 Ideas! If you make a swishy robot share it with me!

Рекомендации по теме
Комментарии
Автор

I don't even code in JS, but I love to watch your coding challenges

ga_per
Автор

The way how i love this guy... what an amazing human being.

raqha
Автор

Entire Lockdown was passed on NoC videos! Gotta love your coding and teaching style!

rikilshah
Автор

Recreating these coding challenges at home is so much fun, thank you for making this content!

teo
Автор

And everything’s all boingy boingy boingy, indeed.

ChaoteLab
Автор

Oh my god, this video just gave me a huge inspiration for how to implement my own kinda simple version of "force directed graphs" (using forces to visually align nodes in a graph so they don't overlap and so on).
I have been playing around with FDGs to visualize my NEAT neural networks but couldn't quite get it right so far, but using this video's ideas as a basis is so simple yet so genius, I didn't even think about it until now :D

Thank you so so much, Dan! I am super excited to try this out! :D

NoMercy
Автор

now i really know how much hard work was put in matter.js

sarvagyasingh
Автор

I've been re-watching some of your earlier work, which I've always enjoyed, and it's nice to see you just continually getting better. Your explanations, and your coding, feel smoother. No more spending half-hours tracking down "this dot" errors :) !

ryaneakins
Автор

It's great to see you doing coding challenges again! :)

Your other recent videos are probably just as good, but somehow an "I'm making a thing" video is a lot more clickable to me than "I'm teaching a thing".

mebamme
Автор

You are an amazing teacher! The way you explain things and concepts is astonishing as well as entertaining! Thanks for all the efforts

alionurtepeciklioglu
Автор

That's so cool! I finally understood the idea behind springs

joaoferreira_yt
Автор

i am often in aw of mathematiciansform the past. Hooke worked out this on paper with no way of simulating it in real time to test his theories. incredible.

andrewweller
Автор

Thank you so much for this tutorial.. I started programming recently and have been really fascinated with all the simulation things you do on your channel. I tried doing them on my own at first just to gauge my knowledge level, but that didn't work out so well. I followed this tutorial and your other on springs and they were soo helpful. Thank you so much!! I was able to implement this in python using the pygame module. The only part I couldn't add was the curvedvertex stuff but I'm happy with what I have already, there is so much I can do with this.

udamaefule
Автор

Thank you! I found your channel recently, and now I’ve started coding again after many years paus. Love your energy and the enjoyable way you talk about maths and physics. Schools should adopt this way of teaching.
I’m looking forward to going through all your videos! Thanks again!

arvendal
Автор

I never thought playing with a springy string could be so meditative. Thanks for a fun challenge. I learned a lot!

DrawMakeCode
Автор

Such an enthusiastic and great teacher. I really enjoyed this.

kittgs
Автор

I want to go to NYU just to take his classes

nothingnoone
Автор

12:56 Interesting! I couldn't remember how to implement rest length, so what I ended up doing was taking the amount of displacement from the anchor, I normalized it, then I multiplied it by a constant that could be attained through some mathematics applied to your rest length, then I just added that value back in to the velocity, this does the exact same thing as what you did here, but likely a little more complicated and for no particular reason.

flameofthephoenix
Автор

hi sir i am from india and i am you fan and i aslo made all the projects that you showed in p5.js .i will be very glad to see you in next video

malharsardeshmukh
Автор

Love your teaching style, would be awesome to see a video on correlation

researchandbuild