5.6 Vector Dot Product (Scalar Projection) - The Nature of Code
The Coding Train The Coding Train
1.7M subscribers
39,763 views
1.2K

 Published On Oct 13, 2021

This video covers the dot product and scalar projection with p5.js and vectors, concepts that I’ll need for finding the distance between a point and a line which will lead to the path following steering behavior in the next video! Code: https://thecodingtrain.com/tracks/the...

p5.js Web Editor Sketches:
🕹️ Angle Between: https://editor.p5js.org/codingtrain/s...
🕹️ Scalar Projection: https://editor.p5js.org/codingtrain/s...

🎥 Previous video:    • 5.5 Wander Steering Behavior - The Na...  
🎥 Next video:    • 5.7 Path Following (Steering) - Natur...  
🎥 All videos:    • The Nature of Code  

References:
🔗 Path Following: https://editor.p5js.org/natureofcode/...
🔗 Steering Behaviors for Autonomous Characters: http://www.red3d.com/cwr/steer/
🔗 Scalar Projection: https://en.wikipedia.org/wiki/Scalar_...
🔗 Vector Projection: https://en.wikipedia.org/wiki/Vector_...

Videos:
🎥 3D Rendering with Rotation and Projection:    • Coding Challenge #112: 3D Rendering w...  
🎥 Unit Vector (Normalize):    • 1.5 A Unit Vector (Normalize) - The N...  
🎥 Dot products and duality:    • Dot products and duality | Chapter 9,...  

Timestamps:
0:00 Welcome! What are we looking at today?
1:01 What is scalar projection?
3:04 How do we use dot product to find the scalar projection?
6:13 Let's create a scalarProjection() function.
8:01 Modifying the function to be vectorProjection().
9:42 How is this useful for path following?
11:39 Let's see if it works for finding a point on a path?
13:04 Thanks for watching! See you in the next video about path following.

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

🚂 Website: http://thecodingtrain.com/
👾 Share Your Creation! https://thecodingtrain.com/guides/pas...
🚩 Suggest Topics: https://github.com/CodingTrain/Sugges...
💡 GitHub: https://github.com/CodingTrain
💬 Discord: https://thecodingtrain.com/discord
✪ Nebula: https://go.nebula.tv/codingtrain
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter:   / thecodingtrain  
📸 Instagram:   / the.coding.train  

🎥 Coding Challenges:    • Coding Challenges  
🎥 Intro to Programming:    • Start learning here!  

🔗 p5.js: https://p5js.org
🔗 p5.js Web Editor: https://editor.p5js.org/
🔗 Processing: https://processing.org

📄 Code of Conduct: https://github.com/CodingTrain/Code-o...

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod...

#forbeginners #javascript #p5js

show more

Share/Embed