Game Development Reference
In-Depth Information
to something else.” This is common usage, but be warned that the word
“normal” primarily means “perpendicular” and not “unit length.” Since it
is so common for normals to be unit vectors, we will take care to call out
any situation where a “normal” vector does not have unit length.
In summary, a “normalized” vector always has unit length, but a “nor-
mal” vector is a vector that is perpendicular to something and by convention
usually has unit length.
2.9.1 Official Linear Algebra Rules
For any nonzero vector v , we can compute a unit vector that points in the
same direction as v . This process is known as normalizing the vector. In
this topic we use a common notation of putting a hat symbol over unit
vectors; for example, v (pronounced “v hat”). To normalize a vector, we
divide the vector by its magnitude:
v v
v =
for any nonzero vector v .
Normalizing a vector
For example, to normalize the 2D vector [12,−5],
12
−5
12
−5
12
−5
12
−5
12
13
−5
13
=
12 2 + 5 2 =
=
=
13
12
−5
169
0.923
−0.385
.
The zero vector cannot be normalized. Mathematically, this is not al-
lowed because it would result in division by zero. Geometrically, it makes
sense because the zero vector does not define a direction—if we normalized
the zero vector, in what direction should the resulting vector point?
Figure 2.16
Normalizing vectors in 2D
 
Search WWH ::




Custom Search