Graphics Reference
In-Depth Information
6.2.2 Multiplying a Vector by a Scalar
Given a vector n ,2 n means that the vector's components are doubled. For
example, if
3
4
5
6
8
10
n =
then
2 n =
which seems logical. Similarly, if we divide n by 2, its components are halved.
Note that the vector's direction remains unchanged - only its magnitude
changes.
It is meaningless to consider the addition of a scalar to a vector such as
n + 2, for it is not obvious which component of n is to be increased by 2. If all
the components of n have to be increased by 2, then we simply add another
vector whose components equal 2.
6.2.3 Vector Addition and Subtraction
Given vectors r and s , r ± s is define as
x r
y r
z r
x s
y s
z s
x r ±
x s
r
r =
s =
±
s =
y r ±
y s
(6.7)
z r ±
z s
Vector addition is commutative:
a + b = b + a
(6.8)
+
=
+
=
1
2
3
4
5
6
4
5
6
1
2
3
5
7
9
e . g .
However, like scalar subtraction, vector subtraction is not commutative:
a
b
= b
a
4
5
6
1
2
3
1
2
3
4
5
6
e . g .
=
a (6.9)
Let's illustrate vector addition and subtraction with two examples. Figure
6.5 shows the graphical interpretation of adding two vectors r and s . Note
that the tail of vector s is attached to the head of vector r . The resultant
vector t = r + s is defined by adding the corresponding components of r and
s together. Figure 6.6 shows a graphical interpretation for r
a
b
= b
s . This time the
components of vector s are reversed to produce an equal and opposite vector.
Then it is attached to r andaddedasdescribedabove.
Search WWH ::




Custom Search