Graphics Reference
In-Depth Information
We now need to discover the meaning of i
·
i j
·
j k
·
k i
·
j etc.
·
If we use Eq. (2.3) to evaluate i
i ,weget
cos 0
i
·
i
=
i
i
=
1
The result is 1 because
i
=
1, and the separating angle is 0 , whose cosine is 1. Obviously,
this result also applies to j
k etc., have
a separating angle of 90 , whose cosine is zero. Consequently, all of these terms vanish and we
are left with
·
j and k
·
k . All the other vector combinations i
·
j i
·
k j
·
a
·
b
=
a
·
b
cos
=
x a x b +
y a y b +
z a z b
(2.4)
which is the full definition of the scalar or dot product and should be committed to memory.
Normally, we do not know the value of , and Eq. (2.4) is used to discover its value using
the following equation:
cos 1 x a x b +
y a y b +
z a z b
=
(2.5)
a
b
Note that if a and b are unit vectors, then
cos 1 x a x b +
=
y a y b +
z a z b
Note also that Eq. (2.5) provides an unsigned angle, . But we know that when working in 2D,
clockwise angles are negative, while counter-clockwise angles are positive. Well, the sign of is
available for 2D angles and is determined by the perp product in Section 2.10.
Before proceeding, let's test Eqs. (2.4) and (2.5) with two examples:
Example 1
Find the angle between two vectors a and b , given
a
=
i
+
2 j
+
3 k
and
b
=
4 i
+
5 j
+
6 k
Therefore,
= 1 2
14
a
+
2 2
+
3 2
=
and
4 2
77
b
=
+
5 2
+
6 2
=
Using Eq. (2.4), we find
14 77 cos
a
·
b
=
=
1
×
4
+
2
×
5
+
3
×
6
=
32
Using Eq. (2.5), we get
cos 1
32
14 77
129
=
=
 
Search WWH ::




Custom Search