Graphics Reference
In-Depth Information
Expanding Eq. (6.23), we obtain
2
x
v
+
y
v
+
2x
v
x
t
+
+
x
t
+
y
t
−
r
2
=
2y
v
y
t
0
which is a quadratic in and solved using
±
√
B
2
=
−
B
−
4AC
2A
where
x
v
+
y
v
x
t
+
y
t
−
r
2
A
=
B
=
2x
v
x
t
+
y
v
y
t
C
=
and can be represented by
2
x
v
y
v
x
t
y
t
−
x
v
x
t
+
y
v
y
t
±
r
2
x
v
+
y
v
−
=
(6.24)
x
v
+
y
v
The value of the discriminant of Eq. (6.24) determines whether the line intersects, is tangential,
or misses the cylinder:
Miss condition
2
r
2
x
v
+
y
v
−
x
v
y
v
x
t
y
t
< 0
Tangential condition
2
r
2
x
v
+
y
v
x
v
y
v
x
t
y
t
−
=
0
Intersect condition
2
r
2
x
v
+
y
v
−
x
v
y
v
x
t
y
t
> 0
It is highly unlikely that the cylinder will be aligned with the z-axis. And as we saw with the
ellipsoid, it is simpler to subject the intersecting line L to the cylinder's inverse transforms:
L
=
S
−
1
R
−
1
T
−
1
·
·
·
L
So, let's leave the cylinder aligned with the z-axis and use an appropriately transformed line. If
the line equation is
p
=
t
+
v