Draw one arrow from the origin to and another to . They look perpendicular, but a drawing is only an estimate, and in four or more dimensions there is no drawing to look at. This lesson builds one computation from the coordinates, the dot product, and shows that it settles questions of length, distance, perpendicularity and angle exactly, in any number of dimensions. Throughout the page a tuple such as stands for a column vector.
Key terms
Dot product
Definition For vectors and in , the dot product is the real number
The row times the column is a matrix, identified with that number. The dot product is defined only when both vectors have the same number of entries. For all in and every real it satisfies
and , with equality only for .
In plain words Multiply matching entries and add. The answer is a single number, not a vector. It is linear in each input while the other input stays fixed.
Example For and the products are and , so . For we get . Doubling only doubles this to , while doubling both vectors gives , four times the original. The dot product is linear in each input separately, not in the pair at once.
Euclidean length
Definition The Euclidean length, or norm, of in is
It satisfies , with only for , and for every real . In and it is the length given by the Pythagorean theorem, applied once in the plane and once more for the third coordinate.
In plain words Square every entry, add, and take the square root. Squaring removes signs, so an entry of contributes as much as an entry of .
Example The vector has length , and has length . Scaling by gives , whose length is . The scalar reverses the direction, but its absolute value is what multiplies the length.
Unit vector
Definition A unit vector is a vector of length . For a nonzero vector , the vector
is the unit vector in the direction of . Producing it is called normalizing . The zero vector cannot be normalized, since its length is and it has no direction.
In plain words Normalizing keeps the direction and resets the length to one, by dividing every entry by the length.
Example The vector has length , so its unit vector is
and the squares of its entries add to . Likewise has length and normalizes to . The unit vector pointing the opposite way is .
Distance between vectors
Definition The distance between vectors and in is , the length of their difference. It equals . Expanding the squares entry by entry gives
because each entry contributes .
In plain words Subtract first, then measure. The distance is the length of the arrow that runs from the tip of one vector to the tip of the other.
Example For and the difference has length . The expansion agrees, since , and give .
Orthogonal vectors
Definition Vectors and in are orthogonal if . By the expansion of the squared distance, this happens exactly when
which for nonzero vectors in or is the Pythagorean condition for a right angle between them. So for nonzero vectors in the plane or in space, orthogonal means perpendicular. In higher dimensions the dot product condition is the definition. The zero vector is orthogonal to every vector.
In plain words For nonzero vectors, zero dot product is the coordinate test for a right angle. It works in every dimension, even where no picture is available to check.
Example The opening pair passes the test, since . In take and . The products cancel, so the vectors are orthogonal although no single product is zero. As a check, , , and the difference has squared length , as the identity above requires.
Angle between nonzero vectors
Definition For nonzero vectors and in , the angle between them is the unique with such that
In and this agrees with the geometric angle. The law of cosines for the triangle with corners , and gives
and comparing with the expansion of the squared distance leaves . In higher dimensions the formula is the definition. It makes sense because the quotient always lies between and , a fact called the Cauchy-Schwarz inequality and proved in the next lesson. The angle is not defined when either vector is zero.
In plain words Dividing by both lengths leaves a number that compares directions only. For nonzero vectors, a positive dot product means an acute angle or the angle , zero means a right angle, and a negative dot product means an obtuse angle or the straight angle .
Example For and , the dot product is and both lengths are , so and . For and the dot product is and the product of the lengths is , so and . The second vector is a negative multiple of the first and points the opposite way.
Check yourself
- Find the length of and the unit vector in its direction.
Show the answer
The squared length is , so . Dividing each entry by gives the unit vector , and indeed .
- Let and . Decide whether the angle between them is acute, right or obtuse, and find their lengths and the distance between them.
Show the answer
The dot product is , and both vectors are nonzero, so the angle is a right angle. The lengths are and . The difference has squared length , so the distance is . The expansion confirms it, since .
- One classmate says the distance between and is , the difference of their lengths. Another says the zero vector makes a right angle with , because their dot product is . Correct both claims.
Show the answer
The distance is the length of the difference, not the difference of the lengths. Here , whose length is .
The zero vector is orthogonal to , since the dot product is . But it has no direction, so there is no angle between it and anything. The angle formula would divide by . Orthogonality extends to the zero vector, while angles and right angles need two nonzero vectors.