So what actually is the Dot Product?

Поділитися
Вставка
  • Опубліковано 3 січ 2025

КОМЕНТАРІ • 39

  • @edwardgongsky8540
    @edwardgongsky8540 24 дні тому +4

    Currently taking an intro ML course right now, and this really helps understanding the real meaning of things, so thank you!

    • @jtmaths
      @jtmaths  24 дні тому

      @@edwardgongsky8540 glad you found it useful!

  • @varshneydevansh
    @varshneydevansh 5 місяців тому +4

    I love the analogy and no background music that too straight tot the point. Immediately subbed

  • @tony_T_
    @tony_T_ Місяць тому +2

    This literally just blew my mind. I'm in precalculus BC right now and we haven't gotten to vectors yet, but I'm interested in learning. I've already spent a bit of time trying to understand it, but I've been thinking about it wrong the entire time; as a completely separate topic. I never realized that it's all connected, and dot products are LITERALLY the unit circle.
    The graphical representation of the projected length of the vector onto the x-axis as the angle changes is a cosine wave spanning from 0 --> π. It could be continued to 2π, but all the information that's needed is in the first half. The cosine wave is just a representation of how the x-coordinate changes as you move along the circumference of the circle. This is where cos θ comes into the equation. On the unit circle, cos θ is the x-value at a certain angle. As the angle (θ) changes, so does that x-value. This is the same thing that happens with these vectors. As the angle (θ) changes between the two vectors, the length (x-value) of the projected vector changes as well. This is why when the two vectors are at a 90º angle, the dot product is equal to 0. This can be verified with the unit circle, where when the angle is = 90º, cos θ is 0.
    Since we are using vectors and not the unit circle; that is where the |a||b| comes from. Then cos θ broadens the equation to include the fact that we are trying to find the x-value (cos) of vector A when it's projected onto vector B at the angle (θ) created by the two vectors. Hence, |a||b| cos θ.
    Idk if what I explained actually makes any sense, but in my head it does. If I'm misunderstanding something, please lmk.

    • @jtmaths
      @jtmaths  Місяць тому +1

      @@tony_T_ yup! Seems like you understand it very well. It makes me so happy that my video can provide a satisfying understanding to you about the product, since I remember how frustrated I was learning about it at first.
      You might find my most recent video about the dot product too - it just goes more in depth about where exactly it comes from and why it makes sense to define it this way.
      Thanks again for the lovely comment! It really made my day :)

    • @idkwhatIshouldsayhere
      @idkwhatIshouldsayhere 27 днів тому

      pre calc bc?

    • @tony_T_
      @tony_T_ 26 днів тому

      @idkwhatIshouldsayhere Yeah

  • @infintysolar1539
    @infintysolar1539 4 місяці тому +4

    Yh the car analogy rlly helped when i heard of it i think it was from eddie woo who told it to me

  • @jeffreyhunter4115
    @jeffreyhunter4115 Місяць тому +4

    Great analogy using a car. Thank you for sharing!

    • @jtmaths
      @jtmaths  Місяць тому

      Glad you found it to be useful, and thank you for the feedback! :D

  • @rogerdodger8813
    @rogerdodger8813 12 днів тому +2

    Not sure about the car explanation 10N plus 5N is 15N not 50N. You add vectors to find direction and magnitude.

    • @jtmaths
      @jtmaths  12 днів тому +1

      @@rogerdodger8813 The car was an arbitrary example - my aim wasn’t to give a rigorous meaning of what the dot product is, but rather an intuitive feel for what it’s doing. I’m aware that you can find the resultant force normally, but the dot product can kinda be thought of as an arbitrary scalar metric for how much two vectors are ‘helping each other.’ This is why I rubbed out the N in ‘50N’ because I realised I had written it in by mistake

  • @Raghav_Garg.68
    @Raghav_Garg.68 18 днів тому +2

    I thought it is 4.9 Million views ! 😂😂
    but you deserve the same
    keep goinn
    you just got a Sub

  • @michaelzap8528
    @michaelzap8528 Місяць тому +2

    Pot product basically tell how two (or many) things close each other. that's the logic behind AI machine learning. In AI, everything is represented by vector(s). using dot product operation , we can automatically( use GPU) to calculate how two thing related each. we find Paris vector dot to France vector , the result value is almost 1. while Beijing vector dot France vector is almost zero, so machine (AI) "learn" , Paris is more close France than China.

    • @carultch
      @carultch 12 годин тому

      What is Paris, Texas dot France?

  • @davidmurphy563
    @davidmurphy563 12 днів тому +1

    Absolutely, it's a test of similarity. I was coding computer games for ages and that's all i thought of it as. Turns out it's actually the key to LA.
    It's actually v*vt. See it this way and it's just standard matrix multiplication. How much of this vector is in that one. Or equivalently, how does this vector project onto that one as a proportion of that vector.
    So if you've got 2 components and one is the identity. [[1], [0]].dot([[2], [3]]) this says you want only the x conponent and discard the y.
    It's just a ratio. The first vector is saying to the 2nd vector: i want this much x and this much y please.
    The fact it's the cosine is cool and all but you're far better off keeping this to LA.
    In this way, you can take an orthonormal basis matrix and pull out of the dimensions simply by protecting them onto each axis of the basis matrix.
    Sorry, waffling.

    • @jtmaths
      @jtmaths  12 днів тому

      @@davidmurphy563 that sounds really interesting! I’ll have to look into it, because to be perfectly honest, I’m not too familiar with linear algebra (I’m still in secondary school lol), but the dot product shows up on the Irish Leaving Certificate as a standalone thing in Applied Maths without much explanation, so I wanted to make a simple video requiring very little prior knowledge to give an intuition for what it is. Thanks for the comment, I’ll look into that! 😄

    • @davidmurphy563
      @davidmurphy563 12 днів тому +1

      @@jtmaths Ah, good one you! What you said was all very correct. As usual with maths, there's just much more lurking beneath the surface but it's turtles all the way down. :)
      The dot product alone is incredibly useful. You can use it in physics like you did with the car.
      Want an npc to have a vision cone in a computer game? Minus the npc's position from the player's, normalise it (give it a length of one unit, that's just pythagoras) and then take the dot between the vector the npc is facing and the player. Notice how when you go from a 2d vector to a 1d scalar you lose information (you don't know if it's to the left or right).
      Attention matrices in large language models use the dot product to test the similarity of tokens.
      3D graphics engines, want to project your 3d objects onto your camera screen? Dot product. What to see if a ray hit an object. Guess what.
      The Google algorithm is a markov matrix I believe.
      The power of LA is that you can define the space itself that the vector is in. This is a matrix called a basis. You just use 2 other vectors to set x and y. So:
      {{1, 0}
      {0, 1}}
      The column on the left is a vector saying that x points 1 in the x direction. And the second column y says it's going 1 in the y direction. The standard basically.
      So you have a vector {{1}, {2}} all you do is take the dot product from first the x column and then the y column and... in the case nothing happens because it's the identity. Like timesing by 1 on the number line.
      But take the dot products of this:
      {{2, 0}
      {0, 2}}
      and you've made it twice as big {{2}, {4}}.
      {{0, -1}
      {1, 0}}
      and you've rotated the space by 90 degrees and then plotted the vector in the new space...
      That's the gist of it.

  • @3pints
    @3pints 5 місяців тому +8

    I liked the explanation at the start of component forces but, the dot product using this car analogy leads to a couple issues I feel.
    The dot product outputs 50 (N...) for the first two scenarios, for the "overall force we are pushing on the car" but, this is physically speaking incorrect for the car, the result is 15N newton in the positive x direction,
    In this scenario the dot product moreso would find how similar(+) or different(-) the two forces are (like when you say how much your friend is helping you) BUT while using an abstract SCALAR metric, like how you knew to remove the N sign from your different dot product examples.
    It doesn't work in Newtons, but if you did want to then you would:
    1. compare the forces in Newtons, by subtracting each force's x & y component from the other's to see the difference
    2. find the "overall force we are pushing on the car" in Newtons, by adding each force's x & y component together and use Pythagoras to summarise the information into an amount of Newtons and resulting direction
    I'm sure this isn't news to you considering you have a maths UA-cam channel, but in this example it just happens that physics denies that the result is how the dot product processes two forces... Mechanical work is an example that is more fitting in physics for the dot product!
    Good interesting video Irish brother

    • @jtmaths
      @jtmaths  5 місяців тому +3

      Yeah you’re definitely right about that. My aim with this video was to give a better intuition as to what the dot product means, not necessarily rigorous uses of it.
      When I learned about the dot product, I was told it’s a measure of “how parallel two vectors are,” which has even more issues than the force analogy. And you’re also right that I should’ve said that it is indeed an “arbitrary scalar metric” - some people might think, due to my explanation, that the dot product can be used to find the resultant force in a direction, which of course isn’t true.
      Thanks for pointing all of that out. It was very insightful and interesting! 😄

  • @King-sd5vg
    @King-sd5vg 2 дні тому +1

    What is the program you are using for this?

    • @jtmaths
      @jtmaths  День тому +1

      @@King-sd5vg OneNote for Windows 10 :)

    • @King-sd5vg
      @King-sd5vg День тому +1

      @jtmaths Thank you. I'm surprised OneNote looks so good! Great video, by the way; it's really well worded. I like watching stuff I've learned and seeing other people's breakdown because it offers different ways to visualize one concept.

  • @nipunchamaramuthugala335
    @nipunchamaramuthugala335 4 місяці тому +2

    Thank you so much...! 😊

  • @minhnhatomorrow
    @minhnhatomorrow 16 днів тому +1

    It look like the formula of work: A = F. S. cosθ where the unit of A is Jun

    • @jtmaths
      @jtmaths  16 днів тому

      @@minhnhatomorrow well spotted! Work done is an example of an application of the dot product in physics!

  • @riverboi1328
    @riverboi1328 3 дні тому

    hey can you also explain cross product

    • @jtmaths
      @jtmaths  2 дні тому +1

      @@riverboi1328 if I can come across an interesting unique explanation for it, I will, but you could look at 3Blue1Brown’s video for now. I haven’t done a whole lot of linear algebra by myself, so I don’t know exactly what is difficult to understand or visualise, so I don’t feel qualified to make such a video yet, but I’ll look into it! 😄

    • @carultch
      @carultch День тому +1

      The dot product is a product of vector magnitudes and a trig function that measures how aligned they are, i.e. cosine.
      The cross product is also a product of vector magnitudes, but instead it uses a trig function that measures how "crossed" (i.e. perpendicular) they are, i.e. sine. Unlike the dot product which is a scalar, the cross product is assigned to a 3rd direction that is mutually perpendicular to the two input vectors. By convention, we use the right hand rule to assign which direction that is, based on which input vector is first.
      Cosine is maximum for aligned vectors, zero for crossed vectors, and at a negative of its maximum for antiparallel vectors.
      Sine is zero for aligned or antiparallel vectors, and maximum for crossed vectors. So the cross product is its greatest, when the two input vectors are crossed with each other.
      Component-wise, the dot product multiplies corresponding components, and adds them up. The component-wise cross product requires you to set up a 3x3 matrix of the 3 axis unit vectors on the top row, and the two input vectors in the next two rows. You then take a determinant of this matrix. My preferred method is the Rule of Sarrus, using positive down-right diagonals and negative down-left diagonals.
      An application of the cross product, is torque. Your wrench radius, your force, and how crossed these two vectors are, determines how much rotational twisting force you apply (i.e. torque). The direction of the torque is assigned in the direction a standard right-handed fastener would move, if you rotate it that way. So a CCW torque is assigned a direction toward you, and a CW torque is assigned a direction away from you.

  • @benoit2234
    @benoit2234 10 днів тому +1

    Aren't you explaining the intuition behind vector addition? The explaination of pushing the car falls under addition i'm afraid

    • @jtmaths
      @jtmaths  7 днів тому

      It's similar, but not exactly. Vector addition wouldn't yield a negative result when the angle between the vectors is more than 90 degrees, so it's not exactly a measure of how much two vectors "help each other," like the dot product is.

    • @benoit2234
      @benoit2234 7 днів тому

      @@jtmaths oh so like how when one vector helps another, it basically increases itself too

    • @jtmaths
      @jtmaths  7 днів тому

      @@benoit2234that’s not what the dot product is saying - it’s giving an arbitrary measure of how much two vectors are ‘helping each other’. I understand what you mean though, and this logic does have flaws, but it’s the easiest way to think about it for people who don’t know much linear algebra (which is the case for people take Applied Mathematics in Ireland - all you really learn is what a vector is and how to calculate the dot product).

  • @rosskious7084
    @rosskious7084 13 днів тому +1

    Me thinketh that one of ye problems is a hair off. One guy pushing with 10n and his little friend pushing in the SAME direction with 5 is additive. That makes 15 not 50n. Me thinketh you need to take cos of helping vector then add it. (This assumes you’re pushing straight in to the object.) divide the dot product by the magnitude of both vectors multiply together then times it times the little helping vector.

    • @jtmaths
      @jtmaths  13 днів тому

      @@rosskious7084 yeah something I forgot to state is that you can think of the dot product as an arbitrary metric of how much two vectors help each other - there isn’t a unit, it was my mistake that I wrote 50N. Well spotted! 😄

  • @Bob-x7m1v
    @Bob-x7m1v 7 днів тому

    This is not dot product but vector addition, what am I missing?

    • @carultch
      @carultch День тому

      It is a dot product, because the vectors are being multiplied, rather than added. It's just the aligned components of the vectors that get multiplied. The visual may look similar to vector addition, but it isn't.
      The two concepts involved in this example, don't have the same units, so it's meaningless to add them. The distance the car moves has units of meters, and the force has units of Newtons. Multiply together and we get Newton-meters, which when representing work (instead of torque), we call Joules.

  • @yunusefeatlganer1207
    @yunusefeatlganer1207 Місяць тому

    Not gonna lie writing components as x_a is crazy...