Graphics Reference
In-Depth Information
In order to isolate , we multiply Eq. (3.71) by
a
⊥
:
a
⊥
·
a
⊥
·
a
⊥
·
b
=
r
−
s
+
a
and as
a
⊥
·
a
=
0,
a
⊥
·
a
⊥
·
b
=
r
−
s
a
⊥
·
r
−
s
=
a
⊥
·
b
from which we can state that
=
−
y
a
x
R
−
x
S
+
x
a
y
R
−
y
S
−
y
a
x
b
+
x
a
y
b
or
x
a
y
S
−
y
R
−
y
a
x
S
−
x
R
=
x
b
y
a
−
x
a
y
b
The coordinates of P are given by
x
P
=
x
R
+
x
a
y
P
=
y
R
+
y
a
or
x
P
=
x
S
+
x
b
y
P
=
y
S
+
y
b
But what if the lines are parallel? Well, this can be detected when
a
0.
Before moving on to the intersection of two line segments, let's test the above equations with
an example.
=
t
b
, i.e., x
b
y
a
−
x
a
y
b
=
Y
2
R
r
P
a
b
s
S
2
X
Figure 3.34.
Figure 3.34 shows two lines intersecting at P. The line equations are given by
r
=
2
i
+
2
j
and
a
=−
i
−
j
s
=
2
i
and
b
=−
i
+
j