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
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




![Coding Train Live: Riding the Oregon Trail 1
π‘Sign up for the CuriosityStream + Nebula bundle with a 26% exclusive discount ($14.79 for a full year!) at https://curiositystream.com/choochoo. To access my Nebula class, upgrade for $1 per month or $10 for year!
Launching my next project, a p5.js port of the original Apple ][ Oregon Trail game!
π» AppleSoft BASIC 3D Cube https://thecodingtrain.com/challenges//175-3D-cube-applesoft-basic
π» Oregon Trail repo https://github.com/shiffman/Oregon-Trail
0:00 Waiting to Start
6:36 Hello everyone!
23:50 Recent announcements in Discord
25:17 New shorts
30:41 Passengers Showcases
35:03 Design System International Coding Train website case study
45:58 Apple ][ 3D cube challenge
51:43 Comments on Apple ][ 3D cube challenge
1:02:26 My Nebula class What is Code?
1:04:15 CuriosityStream + Nebula bundle
1:27:49 Play The Oregon Trail game
2:05:25 Oh No!
2:08:47 Congratulations! You have made it to Oregon
2:19:04 Create repo for Oregon Trail port to p5.js
Links Discussed:
New Shorts
βΆοΈ YT https://www.youtube.com/shorts/Pfb9IPlP0hA
β° TikTok https://www.tiktok.com/@codingtrain
Featured Showcases:
π¦ https://twitter.com/thecodingtrain/
πΈ https://www.instagram.com/the.coding.train/
Coding Train website case study:
π https://designsystems.international/work/the-coding-train/
π Website: http://thecodingtrain.com/
πΎ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
π© Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
π‘ GitHub: https://github.com/CodingTrain
π¬ Discord: https://discord.gg/hPuGy2g
π Membership: http://youtube.com/thecodingtrain/join
π Store: https://standard.tv/codingtrain
ποΈ Twitter: https://twitter.com/thecodingtrain
πΈ Instagram: https://www.instagram.com/the.coding.train/
π₯ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π 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-of-Conduct
#p5js #oregontrail #game Coding Train Live: Riding the Oregon Trail 1](https://i.ytimg.com/vi/EzYDNydDUfc/mqdefault.jpg)





