If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Vector dot product and vector length

Definitions of the vector dot product and vector length. Created by Sal Khan.

## Want to join the conversation?

• Why learn to do calculations using more than three dimensions if anything more than 3D is just theoretical?
• Well, time-space is 4 dimensional (and some will have you believe 12 dimensional).

More so, because this can be used to handle multiple variables, which have nothing to do with physical space (as we commonly understand them).
• SO...whats the intuition behind scalar/dot product I mean was it just defined that way and what exactly is the point of producing a seemingly arbitrary scalar from two vectors? What function does this new scalar serve?
• If the resulting scalar is zero, then the two vectors are perpendicular. This is quite useful in some cases of graphics programming, ray tracing, etc.
• i still don't understand exactly, what IS a vector????
• More generally, a vector is just a collection of values. If the vector contains 3 values then we say that it's dimension is 3. In physics and geometry/trigonometry we talk about vectors having a magnitude and direction but you can also use vectors to hold other kinds of values. For example, if you were analyzing financial data, a vector might hold several characteristics of a company (e.g. Market Value, Number of Employees, Last Year Income, Last Year Profit, Number of years in business). See this video in the series:

starting at time to see the formal definition of a vector.
• is there any relation between the dot product of two vectors and cosine the angle between them?
• a · b = ‖a‖‖b‖cosθ so solving for the cosine of the angle θ:

cosθ = (a · b) / ‖a‖‖b‖

If a and b are unit vectors then the denominator simplifies to 1, therefore cosθ = a · b.
• How do you take the dot product of three vectors?
• You can't. When you take a dot product, it converts two vectors into a scalar. Attempting another dot product after that is impossible, because you would be trying to dot a scalar with a vector, which violates the definition of the dot product.
• Why is the dot product a•b = a1b1+a2b2+...+anbn?
Is it just randomly difined as such or is there a proof that it has to be this?
• I prefer to think of the dot product as a way to figure out the angle between two vectors.
If the two vectors form an angle A then you can add an angle B below the lowest vector, then use that angle as a help to write the vectors' x-and y-lengts in terms of sine and cosine of A and B, and the vectors' absolute values.
If you do that then you will end up with the equation a·b = |a|·|b|·cos(A).
• How do I find the component of a vector in a certain direction using dot product?
• This is where projections come in. If you have a vector a that you want to project onto a direction given by vector b, you use (a · b)b/(b · b) [that is a dot b over b dot b all multiplied by b]. Note that b · b is the square length of b, so we can write (a · b)b/b², or some might prefer the notation (a · b)b/||b||².

Later on in the Linear Algebra playlist, Sal goes through projections. I can't recommend this MIT lecture highly enough for projections though: http://www.youtube.com/watch?v=Y_Ac6KiQ1t0
• How is it possible for two quantities with direction to have a product that does not have one? If we take two vectors and multiply them using both dot and cross methods then will the solutions vary? Or should we use dot and cross products for different situations? If so, how do we figure out?
(1 vote)
• You shouldn't think of the dot and cross product as "multiplication". Taking a dot product is taking a vector, projecting it onto another vector and taking the length of the resulting vector as a result of the operation. Simply by this definition it's clear that we are taking in two vectors and performing an operation on them that results in a scalar quantity.
We could have defined an operation that takes in two vectors and returns `true` if they are perpendicular, `false` otherwise. Then you'd have an operation that takes in two vectors and results in a boolean value. My point being that you can take any parameter types and return any desired type independently. I don't see how the types are related!