Linear Algebra/Length and Angle Measures
From Wikibooks, the open-content textbooks collection
We've translated the first section's results about solution sets into geometric terms for insight into how those sets look. But we must watch out not to be mislead by our own terms; labeling subsets of
of the forms
and
as "lines" and "planes" doesn't make them act like the lines and planes of our prior experience. Rather, we must ensure that the names suit the sets. While we can't prove that the sets satisfy our intuition— we can't prove anything about intuition— in this subsection we'll observe that a result familiar from
and
, when generalized to arbitrary
, supports the idea that a line is straight and a plane is flat. Specifically, we'll see how to do Euclidean geometry in a "plane" by giving a definition of the angle between two
vectors in the plane that they generate.
- Definition 2.1
The length of a vector
is this.
- Remark 2.2
This is a natural generalization of the Pythagorean Theorem. A classic discussion is in (Pólya 1954).
We can use that definition to derive a formula for the angle between two vectors. For a model of what to do, consider two vectors in
.
Put them in canonical position and, in the plane that they determine, consider the triangle formed by
,
, and
.
Apply the Law of Cosines,
, where θ is the angle between the vectors. Expand both sides
- (u1 − v1)2 + (u2 − v2)2 + (u3 − v3)2
and simplify.
In higher dimensions no picture suffices but we can make the same argument analytically. First, the form of the numerator is clear— it comes from the middle terms of the squares (u1 − v1)2, (u2 − v2)2, etc.
- Definition 2.3
The dot product (or inner product, or scalar product) of two n-component real vectors is the linear combination of their components.
Note that the dot product of two vectors is a real number, not a vector, and that the dot product of a vector from
with a vector from
is defined only when n equals m. Note also this relationship between dot product and length: dotting a vector with itself gives its length squared
.
- Remark 2.4
The wording in that definition allows one or both of the two to be a row vector instead of a column vector. Some books require that the first vector be a row vector and that the second vector be a column vector. We shall not be that strict.
Still reasoning with letters, but guided by the pictures, we use the next theorem to argue that the triangle formed by
,
, and
in
lies in the planar subset of
generated by
and
.
- Theorem 2.5 (Triangle Inequality)
For any
,
with equality if and only if one of the vectors is a nonnegative scalar multiple of the other one.
This inequality is the source of the familiar saying, "The shortest distance between two points is in a straight line."
- Proof
(We'll use some algebraic properties of dot product that we have not yet checked, for instance that
and that
. See Problem 8.) The desired inequality holds if and only if its square holds.
That, in turn, holds if and only if the relationship obtained by multiplying both sides by the nonnegative numbers
and 
and rewriting
is true. But factoring
shows that this certainly is true since it only says that the square of the length of the vector
is not negative.
As for equality, it holds when, and only when,
is
. The check that
if and only if one vector is a nonnegative real scalar multiple of the other is easy.
This result supports the intuition that even in higher-dimensional spaces, lines are straight and planes are flat. For any two points in a linear surface, the line segment connecting them is contained in that surface (this is easily checked from the definition). But if the surface has a bend then that would allow for a shortcut (shown here grayed, while the segment from P to Q that is contained in the surface is solid).
Because the Triangle Inequality says that in any
, the shortest cut between two endpoints is simply the line segment connecting them, linear surfaces have no such bends.
Back to the definition of angle measure. The heart of the Triangle Inequality's proof is the "
" line. At first glance, a reader might wonder if some pairs of vectors satisfy the inequality in this way: while
is a large number, with absolute value bigger than the right-hand side, it is a negative large number. The next result says that no such pair of vectors exists.
- Corollary 2.6 (Cauchy-Schwartz Inequality)
For any
,
with equality if and only if one vector is a scalar multiple of the other.
- Proof
The Triangle Inequality's proof shows that
so if
is positive or zero then we are done. If
is negative then this holds.
The equality condition is Problem 9.
The Cauchy-Schwartz inequality assures us that the next definition makes sense because the fraction has absolute value less than or equal to one.
- Definition 2.7
The angle between two nonzero vectors
is
(the angle between the zero vector and any other vector is defined to be a right angle).
Thus vectors from
are orthogonal (or perpendicular) if and only if their dot product is zero.
- Example 2.8
These vectors are orthogonal.
![]() |
The arrows are shown away from canonical position but nevertheless the vectors are orthogonal.
- Example 2.9
The
angle formula given at the start of this subsection is a special case of the definition. Between these two
the angle is
approximately 0.94radians. Notice that these vectors are not orthogonal. Although the yz-plane may appear to be perpendicular to the xy-plane, in fact the two planes are that way only in the weak sense that there are vectors in each orthogonal to all vectors in the other. Not every vector in each is orthogonal to all vectors in the other.
[edit] Exercises
- This exercise is recommended for all readers.
- Problem 1
Find the length of each vector.
- Answer



- 0

- This exercise is recommended for all readers.
- Problem 2
Find the angle between each two, if it is defined.
- Answer


- Not defined.
- This exercise is recommended for all readers.
- Problem 3
During maneuvers preceding the Battle of Jutland, the British battle cruiser Lion moved as follows (in nautical miles): 1.2 miles north, 6.1 miles 38 degrees east of south, 4.0 miles at 89 degrees east of north, and 6.5 miles at 31 degrees east of north. Find the distance between starting and ending positions (O'Hanian 1985).
- Answer
We express each displacement as a vector (rounded to one decimal place because that's the accuracy of the problem's statement) and add to find the total displacement (ignoring the curvature of the earth).
The distance is
.
- Problem 4
Find k so that these two vectors are perpendicular.
- Answer
Solve (k)(4) + (1)(3) = 0 to get k = − 3 / 4.
- Problem 5
Describe the set of vectors in
orthogonal to this one.
- Answer
The set
can also be described with parameters in this way.
- This exercise is recommended for all readers.
- Problem 6
- Find the angle between the diagonal of the unit square in
and one of the axes. - Find the angle between the diagonal of the unit cube in
and one of the axes. - Find the angle between the diagonal of the unit cube in
and one of the axes. - What is the limit, as n goes to
, of the angle between the diagonal of the unit cube in
and one of the axes?
- Answer
- We can use the x-axis.
- Again, use the x-axis.
- The x-axis worked before and it will work again.
- Using the formula from the prior item,
.
- Problem 7
Is any vector perpendicular to itself?
- Answer
Clearly
is zero if and only if each ui is zero. So only
is perpendicular to itself.
- This exercise is recommended for all readers.
- Problem 8
Describe the algebraic properties of dot product.
- Is it right-distributive over addition:
? - Is is left-distributive (over addition)?
- Does it commute?
- Associate?
- How does it interact with scalar multiplication?
As always, any assertion must be backed by either a proof or an example.
- Answer
Assume that
have components
.
- Dot product is right-distributive.
- Dot product is also left distributive:
. The proof is just like the prior one. - Dot product commutes.
- Because
is a scalar, not a vector, the expression
makes no sense; the dot product of a scalar and a vector is not defined. - This is a vague question so it has many answers. Some are (1)
and
, (2)
(in general; an example is easy to produce), and (3)
(the connection between norm and dot product is that the square of the norm is the dot product of a vector with itself).
- Problem 9
Verify the equality condition in Corollary 2.6, the Cauchy-Schwartz Inequality.
- Show that if
is a negative scalar multiple of
then
and
are less than or equal to zero. - Show that
if and only if one vector is a scalar multiple of the other.
- Answer
- Verifying that
for
and
is easy. Now, for
and
, if
then
, which is k times a nonnegative real. The
half is similar (actually, taking the k in this paragraph to be the reciprocal of the k above gives that we need only worry about the k = 0 case). - We first consider the
case. From the Triangle Inequality we know that
if and only if one vector is a nonnegative scalar multiple of the other. But that's all we need because the first part of this exercise shows that, in a context where the dot product of the two vectors is positive, the two statements "one vector is a scalar multiple of the other" and "one vector is a nonnegative scalar multiple of the other", are equivalent. We finish by considering the
case. Because
and
, we have that
. Now the prior paragraph applies to give that one of the two vectors
and
is a scalar multiple of the other. But that's equivalent to the assertion that one of the two vectors
and
is a scalar multiple of the other, as desired.
- Problem 10
Suppose that
and
. Must
?
- Answer
No. These give an example.
- This exercise is recommended for all readers.
- Problem 11
Does any vector have length zero except a zero vector? (If "yes", produce an example. If "no", prove it.)
- Answer
We prove that a vector has length zero if and only if all its components are zero.
Let
have components
. Recall that the square of any real number is greater than or equal to zero, with equality only when that real is zero. Thus
is a sum of numbers greater than or equal to zero, and so is itself greater than or equal to zero, with equality if and only if each ui is zero. Hence
if and only if all the components of
are zero.
- This exercise is recommended for all readers.
- Problem 12
Find the midpoint of the line segment connecting (x1,y1) with (x2,y2) in
. Generalize to
.
- Answer
We can easily check that
is on the line connecting the two, and is equidistant from both. The generalization is obvious.
- Problem 13
Show that if
then
has length one. What if
?
- Answer
Assume that
has components
. If
then we have this.
If
then
is not defined.
- Problem 14
Show that if
then
is r times as long as
. What if r < 0?
- Answer
For the first question, assume that
and
, take the root, and factor.
For the second question, the result is r times as long, but it points in the opposite direction in that
.
- This exercise is recommended for all readers.
- Problem 15
A vector
of length one is a unit vector. Show that the dot product of two unit vectors has absolute value less than or equal to one. Can "less than" happen? Can "equal to"?
- Answer
Assume that
both have length 1. Apply Cauchy-Schwartz:
.
To see that "less than" can happen, in
take
and note that
. For "equal to", note that
.
- Problem 16
Prove that 
- Answer
Write
and then this computation works.
- Problem 17
Show that if
for every
then
.
- Answer
We will prove this demonstrating that the contrapositive statement holds: if
then there is a
with
.
Assume that
. If
then it has a nonzero component, say the i-th one xi. But the vector
that is all zeroes except for a one in component i gives
. (A slicker proof just considers
.)
- Problem 18
Is
? If it is true then it would generalize the Triangle Inequality.
- Answer
Yes; we can prove this by induction.
Assume that the vectors are in some
. Clearly the statement applies to one vector. The Triangle Inequality is this statement applied to two vectors. For an inductive step assume the statement is true for n or fewer vectors. Then this
follows by the Triangle Inequality for two vectors. Now the inductive hypothesis, applied to the first summand on the right, gives that as less than or equal to
.
- Problem 19
What is the ratio between the sides in the Cauchy-Schwartz inequality?
- Answer
By definition
where θ is the angle between the vectors. Thus the ratio is | cosθ | .
- Problem 20
Why is the zero vector defined to be perpendicular to every vector?
- Answer
So that the statement "vectors are orthogonal iff their dot product is zero" has no exceptions.
- Problem 21
Describe the angle between two vectors in
.
- Answer
The angle between (a) and (b) is found (for
) with
If a or b is zero then the angle is π / 2 radians. Otherwise, if a and b are of opposite signs then the angle is π radians, else the angle is zero radians.
- Problem 22
Give a simple necessary and sufficient condition to determine whether the angle between two vectors is acute, right, or obtuse.
- Answer
The angle between
and
is acute if
, is right if
, and is obtuse if
. That's because, in the formula for the angle, the denominator is never negative.
- This exercise is recommended for all readers.
- Problem 23
Generalize to
the converse of the Pythagorean Theorem, that if
and
are perpendicular then
.
- Answer
Suppose that
. If
and
are perpendicular then
(the third equality holds because
).
- Problem 24
Show that
if and only if
and
are perpendicular. Give an example in
.
- Answer
Where
, the vectors
and
are perpendicular if and only if
, which shows that those two are perpendicular if and only if
. That holds if and only if
.
- Problem 25
Show that if a vector is perpendicular to each of two others then it is perpendicular to each vector in the plane they generate. (Remark. They could generate a degenerate plane— a line or a point— but the statement remains true.)
- Answer
Suppose
is perpendicular to both
and
. Then, for any
we have this.
- Problem 26
Prove that, where
are nonzero vectors, the vector
bisects the angle between them. Illustrate in
.
- Answer
We will show something more general: if
for
, then
bisects the angle between
and 
(we ignore the case where
and
are the zero vector).
The
case is easy. For the rest, by the definition of angle, we will be done if we show this.
But distributing inside each expression gives
and
, so the two are equal.
- Problem 27
Verify that the definition of angle is dimensionally correct: (1) if k > 0 then the cosine of the angle between
and
equals the cosine of the angle between
and
, and (2) if k < 0 then the cosine of the angle between
and
is the negative of the cosine of the angle between
and
.
- Answer
We can show the two statements together. Let
, write
and calculate.
- This exercise is recommended for all readers.
- Problem 28
Show that the inner product operation is linear: for
and
,
.
- Answer
Let
and then
as required.
- This exercise is recommended for all readers.
- Problem 29
The geometric mean of two positive reals x,y is
. It is analogous to the arithmetic mean (x + y) / 2. Use the Cauchy-Schwartz inequality to show that the geometric mean of any
is less than or equal to the arithmetic mean.
- Answer
For
, set
so that the Cauchy-Schwartz inequality asserts that (after squaring)
as desired.
- ? Problem 30
A ship is sailing with speed and direction
; the wind blows apparently (judging by the vane on the mast) in the direction of a vector
; on changing the direction and speed of the ship from
to
the apparent wind is in the direction of a vector
.
Find the vector velocity of the wind (Ivanoff & Esty 1933).
- Answer
This is how the answer was given in the cited source.
The actual velocity
of the wind is the sum of the ship's velocity and the apparent velocity of the wind. Without loss of generality we may assume
and
to be unit vectors, and may write
where s and t are undetermined scalars. Take the dot product first by
and then by
to obtain
Multiply the second by
, subtract the result from the first, and find
Substituting in the original displayed equation, we get
- Problem 31
Verify the Cauchy-Schwartz inequality by first proving Lagrange's identity:
and then noting that the final term is positive. (Recall the meaning
and
of the Σ notation.) This result is an improvement over Cauchy-Schwartz because it gives a formula for the difference between the two sides. Interpret that difference in
.
- Answer
We use induction on n.
In the n = 1 base case the identity reduces to
and clearly holds.
For the inductive step assume that the formula holds for the 0, ..., n cases. We will show that it then holds in the n + 1 case. Start with the right-hand side
and apply the inductive hypothesis
to derive the left-hand side.
[edit] References
- O'Hanian, Hans (1985), Physics, 1, W. W. Norton
- Ivanoff, V. F. (proposer); Esty, T. C. (solver) (Feb. 1933), "Problem 3529", American Mathematical Mothly 39 (2): 118
- Pólya, G. (1954), Mathematics and Plausible Reasoning: Volume II Patterns of Plausible Inference, Princeton University Press






























![\begin{array}{rl}
(\vec{u}+\vec{v})\cdot\vec{w}
&=[\begin{pmatrix} u_1 \\ \vdots \\ u_n \end{pmatrix}
+\begin{pmatrix} v_1 \\ \vdots \\ v_n \end{pmatrix}]\cdot
\begin{pmatrix} w_1 \\ \vdots \\ w_n \end{pmatrix} \\
&=
\begin{pmatrix} u_1+v_1 \\ \vdots \\ u_n+v_n \end{pmatrix}\cdot
\begin{pmatrix} w_1 \\ \vdots \\ w_n \end{pmatrix} \\
&=
(u_1+v_1)w_1+\cdots+(u_n+v_n)w_n \\
&=
(u_1w_1+\cdots+u_nw_n)+(v_1w_1+\cdots+v_nw_n) \\
&=
\vec{u}\cdot\vec{w}+\vec{v}\cdot\vec{w}
\end{array}](http://upload.wikimedia.org/math/8/a/3/8a3bd76e417c709a0c10afdc889432e6.png)























![s=
\frac{[\vec{a}-(\vec{a}\cdot\vec{b})\vec{b}]
\cdot(\vec{v}_2-\vec{v}_1)
}{1-(\vec{a}\cdot\vec{b})^2}.](http://upload.wikimedia.org/math/d/7/a/d7a575da14dbd68f55c500aa7effa509.png)
![\vec{v}=\vec{v}_1+
\frac{[\vec{a}-(\vec{a}\cdot\vec{b})\vec{b}]
\cdot(\vec{v}_2-\vec{v}_1)
\vec{a}}{1-(\vec{a}\cdot\vec{b})^2}.](http://upload.wikimedia.org/math/5/b/b/5bb3072c4f06650b355f4faa1f30e878.png)




![\begin{align}
&=
\bigl[ (\sum_{1\leq j\leq n}{a_j}^2)+{a_{n+1}}^2\bigr]
\bigl[ (\sum_{1\leq j\leq n}{b_j}^2)+{b_{n+1}}^2\bigr] \\
&\quad -
\bigl[\sum_{1\leq k<j\leq n}\bigl(a_kb_j-a_jb_k\bigr)^2+
\sum_{1\leq k\leq n}\bigl(a_kb_{n+1}-a_{n+1}b_k\bigr)^2 \bigr] \\
&=
\bigl( \sum_{1\leq j\leq n}{a_j}^2\bigr)
\bigl( \sum_{1\leq j\leq n}{b_j}^2\bigr)
+
\sum_{1\leq j\leq n}{b_j}^2{a_{n+1}}^2
+
\sum_{1\leq j\leq n}{a_j}^2{b_{n+1}}^2
+
{a_{n+1}}^2{b_{n+1}}^2 \\
&\qquad -
\bigl[\sum_{1\leq k<j\leq n}\bigl(a_kb_j-a_jb_k\bigr)^2+
\sum_{1\leq k\leq n}\bigl(a_kb_{n+1}-a_{n+1}b_k\bigr)^2 \bigr] \\
&=
\bigl( \sum_{1\leq j\leq n}{a_j}^2\bigr)
\bigl( \sum_{1\leq j\leq n}{b_j}^2\bigr)
-\sum_{1\leq k<j\leq n}\bigl(a_kb_j-a_jb_k\bigr)^2 \\
&\quad +
\sum_{1\leq j\leq n}{b_j}^2{a_{n+1}}^2
+
\sum_{1\leq j\leq n}{a_j}^2{b_{n+1}}^2
+
{a_{n+1}}^2{b_{n+1}}^2 \\
&\qquad -
\sum_{1\leq k\leq n}\bigl(a_kb_{n+1}-a_{n+1}b_k\bigr)^2
\end{align}](http://upload.wikimedia.org/math/3/5/2/352c9c34427ee8409a9959410870bf6d.png)
![\begin{array}{rl}
&=
\bigl( \sum_{1\leq j\leq n}a_jb_j\bigr)^2
+
\sum_{1\leq j\leq n}{b_j}^2{a_{n+1}}^2
+
\sum_{1\leq j\leq n}{a_j}^2{b_{n+1}}^2
+
{a_{n+1}}^2{b_{n+1}}^2 \\
&\qquad-
\bigl[\sum_{1\leq k\leq n}{a_k}^2{b_{n+1}}^2
-2\sum_{1\leq k\leq n}a_kb_{n+1}a_{n+1}b_k
+\sum_{1\leq k\leq n}{a_{n+1}}^2{b_k}^2\bigr] \\
&=
\bigl( \sum_{1\leq j\leq n}a_jb_j\bigr)^2
+2\bigl(\sum_{1\leq k\leq n}a_kb_{n+1}a_{n+1}b_k\bigr)
+{a_{n+1}}^2{b_{n+1}}^2 \\
&=
\bigl[\bigl(\sum_{1\leq j\leq n}a_jb_j\bigr)+a_{n+1}b_{n+1}\bigr]^2
\end{array}](http://upload.wikimedia.org/math/8/4/0/840ca0351ab4b573f695d306b8c4b9ed.png)