Тёмный

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

The Coding Train
Подписаться 1,7 млн
Просмотров 39 тыс.
50% 1

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: ru-vid.comjoin
🛒 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

Опубликовано:

 

5 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 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!
@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 🤩🤩🤩
@obaydasarahneh236
@obaydasarahneh236 5 месяцев назад
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 9 месяцев назад
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!
@sweethomes674
@sweethomes674 11 месяцев назад
Thank you for teaching the nature of code. It is interesting and informative and enjoyable 😊
@JuanGarcia-lo2el
@JuanGarcia-lo2el 2 года назад
I'm a big fan! I love your videos!
@Brahvim
@Brahvim 2 года назад
Thank you so much, Professor Shiffman!
@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?
@bernardo231
@bernardo231 Год назад
pretty dope! Hello from Brazil!
@davidcastillo3772
@davidcastillo3772 Год назад
this helped so much for my calc 3 class haha thank youuu
@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
@danielg844
@danielg844 2 года назад
I missed your content!!
@aGuyWhoWantsToSudyIGuessEGYbtw
@aGuyWhoWantsToSudyIGuessEGYbtw 5 месяцев назад
Thx For the help
@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
@nagesh007
@nagesh007 2 года назад
Awesome
@TheCodingTrain
@TheCodingTrain 2 года назад
Thank you!
@mahathirscolorworld6818
@mahathirscolorworld6818 9 месяцев назад
u r very nice to look at
@chandlerzhu9735
@chandlerzhu9735 2 года назад
this reminds me of my high school days
@lucian3752
@lucian3752 2 года назад
Like Nr 800 here 😎
@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?
@Coder100
@Coder100 2 года назад
lol our math class is literally doing vectors rn xD
@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
@jensBendig
@jensBendig 2 года назад
I hate the angleBetween-function, it keeps guys from getting into this. And „this“ is great!
@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
@shilpiverma6240
@shilpiverma6240 2 года назад
i m your biggest fan plz code a cool game
@sokcheadouble5192
@sokcheadouble5192 2 года назад
Hi, have you been a JavaScript Constutor ? I want enroll your class
@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.
@obedotto4465
@obedotto4465 2 года назад
7:06 this dot
@geoffwagner4935
@geoffwagner4935 Год назад
no i can honestly say I've never googled that, in my life
@Jkauppa
@Jkauppa 2 года назад
this dot
@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
@dgloria
@dgloria 2 года назад
:O
@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!
@toastyPredicament
@toastyPredicament 2 года назад
I wrote you a letter and deleted it after the weed pen commenttttt
@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.
@bajrangi303
@bajrangi303 Год назад
Abe angrej, 🍳kabhi hindi bhi bol liya kr 🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🌬️🌬️🌬️🌬️
Далее
5.7 Path Following (Steering) - Nature of Code
15:41
Просмотров 105 тыс.
1.1 What is a Vector? - The Nature of Code
15:43
Просмотров 128 тыс.
Bézier curves (Coding Challenge 163)
22:59
Просмотров 265 тыс.
Genuary After Dark
0:58
Просмотров 12 тыс.
Vector Projections : Data Science Basics
14:58
Просмотров 63 тыс.
#genuary15 physics library!
0:40
Просмотров 189 тыс.
Cross Product and Dot Product: Visual explanation
4:08
Coding Challenge #159: Simple Pendulum Simulation
22:14
Signed Distance Functions & Ray-Marching
24:14
Просмотров 27 тыс.