Graphics Reference
In-Depth Information
B.1.3
Magnitude of a Vector
From Pythagoras, we know the distance between
V
b
and
V
c
,
d
bc
,is
2
2
2
d
bc
=
(
x
b
−
x
c
)
+(
y
b
−
y
c
)
+(
z
b
−
z
c
)
.
From Equation (B.1), we can rewrite
d
bc
as
d
bc
=
(
x
a
)
2
+(
y
a
)
2
+(
z
a
)
2
.
Recall that
x
a
,
y
a
,and
z
a
are the components of vector
V
a
, the vector that took
us from position
V
b
to
V
c
. In other words, vector
V
a
has moved position
V
b
by
a distance of
d
bc
. Notice that the distance moved by
V
a
is the square root of the
sum of the squares of all its components. This observation is true in general that
given any vector,
V
,
=
v
x
v
y
v
z
,
V
will move any point by a distance of
V
,where
v
x
2
v
y
2
v
z
2
V
=
+
+
.
(B.2)
V
is defined as the size or magnitude of the vector.
B.1.4
Direction of a Vector
If we scale the components of the vector by the inverse of its magnitude,
v
x
v
x
v
x
2
v
x
=
v
z
2
=
,
V
v
y
2
+
+
v
y
v
y
v
x
2
v
y
=
v
z
2
=
,
V
(B.3)
v
y
2
+
+
v
z
v
z
v
x
2
v
z
=
v
z
2
=
,
V
v
y
2
+
+
then the vector
V
,
=
v
x
v
y
v
z
,
V
has magnitude
V
=
1
.
0
.
This is because
v
x
+
V
=
v
y
+
v
z
,
Search WWH ::
Custom Search