tubeshowcase●1,029,126 videos♡ My collection 0
← Learn to Code

Learn to Code45:13

Coding Challenge #56: Attraction and Repulsion Forces

The Coding Train ↗

From the creator

In this challenge, I create a particle system and add "attractors" simulating attraction and repulsion forces. Code: https://thecodingtrain.com/challenges/56-attraction-and-repulsion-forces 🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/6WL2O4vq0 🎥 Previous video: https://youtu.be/f5QBExMNB1I?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH 🎥 Next video: https://youtu.be/ZiYdOwOrGyc?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH 🎥 All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH Videos: 🚂 Vectors Video: https://youtu.be/vqE8DMfOajk 🚂 Gravitational Attraction: https://thecodingtrain.com/tracks/the-nature-of-code-2/noc/2-forces/5-gravitational-attraction 🔴 Live Stream #76: https://youtu.be/OkkjlHTdLGI?t=4692 Timestamps: 00:00 Introduction to the Challenge! 02:31 Explanation of Gravitational Attraction 05:04 Create a particle and an attractor 07:26 Add physics to the particles 11:09 Explanation of force and Newton's Second Law 13:04 Create the attraction force vector 17:51 Fine tuning the attraction force 19:34 Drawing the trails of the particle 20:37 Adding multiple particles and other changes 23:08 Adding multiple attractors 27:13 More visual changes and emerging patterns 32:31 Creating attractors with the mouse 35:11 Add repulsion force 35:55 Create alternating attractors and repellers 37:59 Suggestions for improvement and tuning parameters 38:30 Adding repulsions when particle is close to the attractor 43:42 Wrapping up and m

Published 2017-02-09 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code