Graphics Reference
In-Depth Information
Now let's consider the solution for a 2D or 3D line.
We begin with the scenario shown in Fig. 3.29.
Q
Y
q
R
ε
v
T
u
r
t
P
p
X
Figure 3.29.
The objective is to find an equation defining
q
in terms of
p
v
, and
t
. We start with
=
−
u
r
p
Let
r
=
t
+
v
where is a scalar
(3.59)
Therefore,
u
=
t
+
v
−
p
Because
u
is perpendicular to
v
,
r
and
p
have the same projection on
v
. Therefore,
v
·
r
=
v
·
p
(3.60)
Using
v
, take the dot product of Eq. (3.59):
v
·
r
=
v
·
t
+
v
·
v
(3.61)
Substituting Eq. (3.60) in Eq. (3.61) gives
v
·
p
=
v
·
t
+
v
·
v
Therefore,
v
·
p
−
t
v
·
p
−
t
=
=
(3.62)
2
v
·
v
v
Therefore, we can write
q
=
p
+
u