Vector Dot Product (Scalar Projection)
Nature of Code Lesson #5.6
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!
Topics
- 0:00 - Welcome! What are we looking at today?
- 1:01 - Explain! What is scalar projection?
- 3:04 - Explain! How do we use dot product to find the scalar projection?
- 6:13 - Code! Let's create a scalarProjection() function.
- 8:01 - Code! Modifying the function to be vectorProjection().
- 9:42 - Explain! How is this useful for path following?
- 11:39 - Code! 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.
Community Contributions
It seems like there haven't been made any variations based on this lesson by the community yet. Be the first and add your own! If you don't know how, take a look at this guide.
Links discussed in this lesson
Videos discussed in this lesson
- 3D Rendering with Rotation and Projection - Coding Challenge 112 by The Coding Train
- Unit Vector (Normalize) - Nature of Code 1.5 by The Coding Train
- Dot products and duality by 3Blue1Brown