Game Development Reference
In-Depth Information
One quick note to satisfy all you sticklers who already know about vector
norms and at this moment are pointing your web browser to gamemath.com,
looking for the email address for errata. The term norm actually has a very
general definition, and basically any equation that meets a certain set of
criteria can call itself a norm. So to describe Equation (2.2) as the equation
for the vector norm is slightly misleading. To be more accurate, we should
say that Equation (2.2) is the equation for the 2-norm, which is one specific
way to calculate a norm. The 2-norm belongs to a class of norms known as
the p-norms, and the p-norm is not the only way to define a norm. Still,
omitting this level of generality isn't too harmful of a delusion; because
the 2-norm measures Euclidian distance, it is by far the most commonly
used norm in geometric applications. It is also widely used in situations
even where a geometric interpretation is not directly applicable. Readers
interested in such exotica should check out Exercise 15.
2.8.2
Geometric Interpretation
Let's try to get a better understand-
ing of why Equation (2.3) works. For
any vector v in 2D, we can form a right
triangle with v as the hypotenuse, as
shown in Figure 2.14.
Notice that to be precise we had
to put absolute value signs around the
components v x and v y . The compo-
nents of the vector may be negative,
since they are signed displacements, but
length is always positive.
The Pythagorean theorem states
that for any right triangle, the square
of the length of the hypotenuse is equal
to the sum of the squares of the lengths
of the other two sides. Applying this theorem to Figure 2.14, we have
v 2 = |v x | 2 + |v y | 2 .
Since |x| 2 = x 2 , we can omit the absolute value symbols:
v 2 = v x 2 + v y 2 .
Then, by taking the square root of both sides and simplifying, we get
Figure 2.14
Geometric interpretation of the
magnitude equation
v 2 =
v x 2 + v y 2 ,
v x 2 + v y 2 ,
v =
Search WWH ::




Custom Search