Game Development Reference
In-Depth Information
2.5.1
Official Linear Algebra Rules
To negate a vector of any dimension, we simply negate each component of
the vector. Stated formally,
2
3
2
3
Negating a vector
a 1
a 2
.
a n−1
a n
−a 1
−a 2
.
−a n−1
−a n
4
5 =
4
5 .
Applying this to the specific cases of 2D, 3D, and 4D vectors, we have
Negating 2D, 3D, and
4D vectors
x y
=
−x
−y
,
x y z
=
−x
−y
−z
,
x y z w
=
−x
−y
−z
−w
.
Figure 2.8. Examples of vectors and their negatives. Notice that a vector and its negative are
parallel and have the same magnitude, but point in opposite directions.
 
Search WWH ::




Custom Search