How to find the dot product and length of a vector
A dot product takes two vectors and gives us a single number. We find it by multiplying the components in matching positions and adding the products. Let’s use that calculation to find a dot product, then the length of a vector.
Multiply matching components and add
For two vectors with the same number of components, use . For example, let and .
Dot a vector with itself to find its squared length
If both vectors are , each product becomes a square. That gives . Taking the nonnegative square root gives the length.
Use the same process in more dimensions
For , square and add all four components.
The order of a dot product can be reversed, so . It also distributes across sums of vectors.
Example: Find dot products in two and three dimensions
For and , multiply the two pairs of matching components.
The same process works with a third component. If and , we get
Use a zero dot product to recognize perpendicular vectors
Two nonzero vectors are perpendicular exactly when their dot product is zero. For example, , so those directions form a right angle. The zero vector also has dot product zero with every vector, but it has no direction and does not define an angle.