Graphics Reference
In-Depth Information
and
⎡
⎣
⎤
⎦
·
⎡
⎣
⎤
⎦
=
⎡
⎣
⎤
⎦
2
1
2
000
00
2
0
1
1
1
0
v
=
1
2
00
0001
0
−
−
1
2
1
Substituting
t
and
v
in Eq. (6.25), we get
1
4
−
2
1
2
0
2
1
1
2
2
2
±
2
±
0
−
5
=
=
=
8 and 12
1
4
1
4
Substituting in Eq. (6.26), we get
p
=
0
+
8
j
+
k
and
p
=
0
+
12
j
+
k
which makes the intersection points 0 8 8 and 0 12 12, as predicted!
What has been covered so far assumes that the cylinder has an infinite extent along the
z-axis, which is not very common. Normally, cylinders have a finite length, and a mechanism
is required to set these physical limits. One convenient method is to identify the minimum and
maximum z-extents of the cylinder, z
min
and z
max
, respectively. And when we calculate the two
possible intersection values for , e.g.,
1
and
2
, we can test whether the z component of
p
is
within the defined range:
z
1
=
z
t
+
1
z
v
z
2
=
z
t
+
2
z
v
by making sure that
z
min
< z
1
z
2
<z
max
Another assumption with the above analysis is that the cylinder is open at either end. If end
caps are required, then plane equations can be placed at z
min
and z
max
as shown in Fig. 6.15.
Y
z
min
z
max
X
Z
Figure 6.15.