5.6 Vector Dot Product (Scalar Projection) - The Nature of Code @TheCodingTrain
5.6 Vector Dot Product (Scalar Projection) - The Nature of Code  @TheCodingTrain
Uploaded October 2021 | Updated November 2026, 10 hours ago
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: thecodingtrain.com/tracks/the-nature-of-code-2/noc/5-autonomous-agents/6-scalar-projection

p5.js Web Editor Sketches:
πŸ•ΉοΈ Angle Between: editor.p5js.org/codingtrain/sketches/ORP5Yx7JX
πŸ•ΉοΈ Scalar Projection: editor.p5js.org/codingtrain/sketches/c4jmHLFQI

πŸŽ₯ Previous video: youtu.be/ujsR2vcJlLk?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
πŸŽ₯ Next video: youtu.be/rlZYT-uvmGQ?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
πŸŽ₯ All videos: youtube.com/playlist?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM

References:
πŸ”— Path Following: editor.p5js.org/natureofcode/sketches/SkMI894DX
πŸ”— Steering Behaviors for Autonomous Characters: red3d.com/cwr/steer
πŸ”— Scalar Projection: en.wikipedia.org/wiki/Scalar_projection
πŸ”— Vector Projection: en.wikipedia.org/wiki/Vector_projection

Videos:
πŸŽ₯ 3D Rendering with Rotation and Projection: youtu.be/p4Iz0XJY-Qk
πŸŽ₯ Unit Vector (Normalize): youtu.be/ttz05d8DSOs
πŸŽ₯ Dot products and duality: youtu.be/LyGKycYT2v0

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: thecodingtrain.com
πŸ‘Ύ Share Your Creation! thecodingtrain.com/guides/passenger-showcase-guide
🚩 Suggest Topics: github.com/CodingTrain/Suggestion-Box
πŸ’‘ GitHub: github.com/CodingTrain
πŸ’¬ Discord: thecodingtrain.com/discord
βœͺ Nebula: go.nebula.tv/codingtrain
πŸ’– Membership: youtube.com/thecodingtrain/join
πŸ›’ Store: standard.tv/codingtrain
πŸ–‹οΈ 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

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

#forbeginners #javascript #p5js
5.6 Vector Dot Product (Scalar Projection) - The Nature of Code3.1 Angles and Rotation - Nature of CodeBack to School on the Coding TrainIn Search of Algorithms? Q&A 1.2 #shortsCoding Challenge 161: Estimating Ο€ from Random Numbers with Euclids AlgorithmCoding Train Live:  Riding the Oregon Trail 1Coding Train Live: Self-Avoiding Walk and Discord botCoding with Processing Release 0001 Alpha   Happy 20th!Coding Challenge 172: Horizontal Directional DrillingNo palettes! #genuary #genuary2Discord Bots 4: Hiding API Keys with .envCoding Challenge 179: Elementary Cellular Automata
The Coding Train |

5.6 Vector Dot Product (Scalar Projection) - The Nature of Code

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER