Graphics Reference
In-Depth Information
for the coefficients a i . On the other hand, if we have an orthonormal basis, then it is
easy to check that a i = v v i and there is nothing to solve. Our first order of business
therefore is to describe an algorithm, the Gram - Schmidt algorithm , which converts an
arbitrary basis into an orthonormal one.
The Gram-Schmidt algorithm is an algorithm that actually can be applied to any
collection of vectors and will produce an orthonormal basis for the space spanned by
these vectors. We shall illustrate how this process works in the case of two and three
vectors.
Let v 1 and v 2 be two nonzero vectors. Then u 1 = (1/| v 1 |) v 1 is a unit vector. We want
to find a unit vector u 2 that is orthogonal to u 1 and so that u 1 and u 2 span the same
space as v 1 and v 2 . Consider Figure 1.3. If we could find the orthogonal vector w , then
all we would have to do is make w have unit length to get u 2 (assuming that w is not
zero). But w can easily be computed from the “orthogonal projection” v of v 2 on u 1
and we pointed out in Section 1.3 that v could be found using the dot product. The
following equations now summarize how one can compute the orthonormal basis u 1
and u 2 :
1
u
=
v
1
1
v
1
1
u
=
w
2
(1.10)
w
where
wv v
vvuu
=-
=∑
2
21 .
(
)
To see that these computations really do produce orthogonal vectors it suffices to show
that the dot product of the vectors w and u 1 is zero. But
∑= - ( [ ]
=∑- ∑
wu
v v uu u
vu vuuu
1
2 2 1 1 1
21 2111
0.
(
)
(
)
=
Next, suppose that we want to construct an orthonormal basis for the space
spanned by three vectors v 1 , v 2 , and v 3 . See Figure 1.4(a). First, apply the construc-
v 2
w
u 2
v 1
v
u 1
Figure 1.3.
A simple orthogonal projection.
Search WWH ::




Custom Search