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

  Рет қаралды 38,433

The Coding Train

The Coding Train

Күн бұрын

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...
p5.js Web Editor Sketches:
🕹️ Angle Between: editor.p5js.org/codingtrain/s...
🕹️ Scalar Projection: editor.p5js.org/codingtrain/s...
🎥 Previous video: • 5.5 Wander Steering Be...
🎥 Next video: • 5.7 Path Following (St...
🎥 All videos: • The Nature of Code 2
References:
🔗 Path Following: editor.p5js.org/natureofcode/...
🔗 Steering Behaviors for Autonomous Characters: www.red3d.com/cwr/steer/
🔗 Scalar Projection: en.wikipedia.org/wiki/Scalar_...
🔗 Vector Projection: en.wikipedia.org/wiki/Vector_...
Videos:
🎥 3D Rendering with Rotation and Projection: • Coding Challenge #112:...
🎥 Unit Vector (Normalize): • 1.5 A Unit Vector (Nor...
🎥 Dot products and duality: • Dot products and duali...
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/pas...
🚩 Suggest Topics: github.com/CodingTrain/Sugges...
💡 GitHub: github.com/CodingTrain
💬 Discord: thecodingtrain.com/discord
✪ Nebula: go.nebula.tv/codingtrain
💖 Membership: kzfaq.infojoin
🛒 Store: standard.tv/codingtrain
🖋️ Twitter: / thecodingtrain
📸 Instagram: / the.coding.train
🎥 Coding Challenges: • Coding Challenges
🎥 Intro to Programming: • Start learning here!
🔗 p5.js: p5js.org
🔗 p5.js Web Editor: editor.p5js.org/
🔗 Processing: processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
#forbeginners #javascript #p5js

Пікірлер: 51
@josephabbey
@josephabbey 2 жыл бұрын
4 minutes in and I already have 5 Wikipedia pages open. Love your content by the way
@TheEarthCreature
@TheEarthCreature Жыл бұрын
You, sir, are a teaching genius. I looked at this on like 20 different videos and read a bunch of different sites and articles and it was not clicking with me. I watched your video and am baffled by how easy this is. Thank you very much!
@obaydasarahneh236
@obaydasarahneh236 4 ай бұрын
What an amazing video despite the fact that I am not understanding the code completely 😢 I learnt c++ so i am understanding javascript but I didn’t reach this coding level
@dominiccirineo1587
@dominiccirineo1587 8 ай бұрын
As a Physics/Math student who absolutely adores vector calculus and vectors, in general, I loved watching someone from a different field of study go through this math and teach it, especially at 2:41 where you were calling the absolute-value brackets "line or pipe things", lol! Amazing work!
@RajJaiswal538
@RajJaiswal538 2 жыл бұрын
Loving the consistency now Just started reading the book yeasterday. It's as amazing as I imagined!
@krishnavyshak
@krishnavyshak 2 жыл бұрын
Sir your vids are super awesome!! I haven't missed a video of yours till now!! When I started learning JavaScript you was my inspiration 🤩🤩🤩
@sweethomes674
@sweethomes674 10 ай бұрын
Thank you for teaching the nature of code. It is interesting and informative and enjoyable 😊
@Brahvim
@Brahvim 2 жыл бұрын
Thank you so much, Professor Shiffman!
@igotapochahontas
@igotapochahontas 2 жыл бұрын
Am I the only one who secretly wants to move to nyc and take this guys course? Theyre seriously the best coding videos on youtube
@JuanGarcia-lo2el
@JuanGarcia-lo2el 2 жыл бұрын
I'm a big fan! I love your videos!
@Nikhil-wz6nt
@Nikhil-wz6nt 2 жыл бұрын
Love your videos ❤️. I have watched the Quatree implementation video and adopted it for my project. Amazing content. Can you make a video on implementation of weighted straight skeleton algorithm?
@davidcastillo3772
@davidcastillo3772 Жыл бұрын
this helped so much for my calc 3 class haha thank youuu
@bernardo231
@bernardo231 Жыл бұрын
pretty dope! Hello from Brazil!
@danielg844
@danielg844 2 жыл бұрын
I missed your content!!
@aGuyWhoWantsToSudyIGuessEGYbtw
@aGuyWhoWantsToSudyIGuessEGYbtw 4 ай бұрын
Thx For the help
@freecell1732
@freecell1732 2 жыл бұрын
Here is cool youtube video idea : program MacOS "Drift" screensaver !
@Timmysthirdbirthday
@Timmysthirdbirthday 2 жыл бұрын
heres a cool idea goodbye
@freecell1732
@freecell1732 2 жыл бұрын
@@Timmysthirdbirthday what does that even mean ?
@Timmysthirdbirthday
@Timmysthirdbirthday 2 жыл бұрын
@@freecell1732 dont contact me goodbye
@Timmysthirdbirthday
@Timmysthirdbirthday 2 жыл бұрын
@@freecell1732 im going to subscribe to you shortly is this ok?
@nagesh007
@nagesh007 2 жыл бұрын
Awesome
@TheCodingTrain
@TheCodingTrain 2 жыл бұрын
Thank you!
@chandlerzhu9735
@chandlerzhu9735 2 жыл бұрын
this reminds me of my high school days
@robertm.6243
@robertm.6243 2 жыл бұрын
Hey Mr. Shiffman, nice video! Have a look at the web editor sketches "angle between" and "scalar projection", they are the same (both angle between)
@TheCodingTrain
@TheCodingTrain 2 жыл бұрын
Yes, need to fix this! you can also always post a note to the website GitHub issues and we might see it sooner! github.com/CodingTrain/website/issues
@mahathirscolorworld6818
@mahathirscolorworld6818 8 ай бұрын
u r very nice to look at
@emekanwoye4951
@emekanwoye4951 2 жыл бұрын
How do I enable other buttons in my sketch window when it runs, so basically I need I stop button and when you click the start Button, every other button becomes disabled. Nothing work until you click on the Stop which is outside the sketch window ... I don't know jow to resolve this.. please help out
@jensBendig
@jensBendig 2 жыл бұрын
I hate the angleBetween-function, it keeps guys from getting into this. And „this“ is great!
@lucian3752
@lucian3752 2 жыл бұрын
Like Nr 800 here 😎
@tomhands7037
@tomhands7037 2 жыл бұрын
in the link above to the "angle between" p5 editor sketch, you call 'rotate(v.heading())' the comment is \\Call vector heading function to get direction (pointing up is a heading of 0) -- if the vector is pointing up wouldn't the heading be 90 degrees or ~1.1 radians
@sokcheadouble5192
@sokcheadouble5192 2 жыл бұрын
Hi, have you been a JavaScript Constutor ? I want enroll your class
@Coder100
@Coder100 2 жыл бұрын
lol our math class is literally doing vectors rn xD
@jangonaut
@jangonaut 2 жыл бұрын
Great Video! But I do not understand why vector B needs to be normalized to calculate the dot product.
@DanKaschel
@DanKaschel 2 жыл бұрын
Because normalizing it gives it an amplitude of 1, and since it is the denominator in the dot product, it can be ignored.
@shilpiverma6240
@shilpiverma6240 2 жыл бұрын
i m your biggest fan plz code a cool game
@geoffwagner4935
@geoffwagner4935 Жыл бұрын
no i can honestly say I've never googled that, in my life
@obedotto4465
@obedotto4465 2 жыл бұрын
7:06 this dot
@Jkauppa
@Jkauppa 2 жыл бұрын
this dot
@dgloria
@dgloria 2 жыл бұрын
:O
@SciencewithRishit
@SciencewithRishit 2 жыл бұрын
Can we learn physics this way?
@RajJaiswal538
@RajJaiswal538 2 жыл бұрын
You can learn the basics this way But it won't be enough to learn physics in detail
@josephabbey
@josephabbey 2 жыл бұрын
"this." And this "dot(...)"
@monsieuralexandergulbu3678
@monsieuralexandergulbu3678 2 жыл бұрын
"as always I always forget the this." "never forget the this." This dot song is amazing :3
@codex2765
@codex2765 2 жыл бұрын
288th
@TheEarthCreature
@TheEarthCreature Жыл бұрын
I think you should consider re-making some of your older series. No offense to you in any way but your original videos were sort of unwatchable IN COMPARISON to the content you're putting out now. You've really grown into making these videos.
@TheCodingTrain
@TheCodingTrain Жыл бұрын
I agree! I'm trying to get to older ones but it's hard to do them all!
@SenthilBabuji
@SenthilBabuji 2 жыл бұрын
So bad this channel has become a paid channel now. Good luck for students who cannot afford that.
@TheCodingTrain
@TheCodingTrain 2 жыл бұрын
Hi Senthil, the next video will be public shortly, it's just not finished and ready yet. A "preview" is available for members. (I am still finishing the code examples and closed captioning).
@SenthilBabuji
@SenthilBabuji 2 жыл бұрын
@@TheCodingTrain Cool. Sorry, my bad. Keep up the good work. Your videos are awesome by the way.
@toastyPredicament
@toastyPredicament 2 жыл бұрын
I wrote you a letter and deleted it after the weed pen commenttttt
@bajrangi303
@bajrangi303 Жыл бұрын
Abe angrej, 🍳kabhi hindi bhi bol liya kr 🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🌬️🌬️🌬️🌬️
5.7 Path Following (Steering) - Nature of Code
15:41
The Coding Train
Рет қаралды 105 М.
Vectors 7.5 Scalar and Vector Projections
20:17
Ms Havrot's Canadian University Math Prerequisites
Рет қаралды 19 М.
Bro be careful where you drop the ball  #learnfromkhaby  #comedy
00:19
Khaby. Lame
Рет қаралды 49 МЛН
1❤️
00:20
すしらーめん《りく》
Рет қаралды 33 МЛН
I Built a Shelter House For myself and Сat🐱📦🏠
00:35
TooTool
Рет қаралды 19 МЛН
어른의 힘으로만 할 수 있는 버블티 마시는법
00:15
진영민yeongmin
Рет қаралды 12 МЛН
Coding Challenge #160: Spring Forces
32:43
The Coding Train
Рет қаралды 100 М.
Everything You Need to Know About VECTORS
17:42
FloatyMonkey
Рет қаралды 1 МЛН
Dot products and duality | Chapter 9, Essence of linear algebra
14:12
3Blue1Brown
Рет қаралды 2,4 МЛН
1.1 What is a Vector? - The Nature of Code
15:43
The Coding Train
Рет қаралды 127 М.
Coding Challenge #159: Simple Pendulum Simulation
22:14
The Coding Train
Рет қаралды 95 М.
The real world applications of the dot product
12:49
Zach Star
Рет қаралды 212 М.
Bézier curves (Coding Challenge 163)
22:59
The Coding Train
Рет қаралды 264 М.
Cross Product and Dot Product: Visual explanation
4:08
Physics Videos by Eugene Khutoryansky
Рет қаралды 947 М.
Coding Challenge 180: Falling Sand
23:00
The Coding Train
Рет қаралды 744 М.
Bro be careful where you drop the ball  #learnfromkhaby  #comedy
00:19
Khaby. Lame
Рет қаралды 49 МЛН