Ray-Cylinder Intersections
1. Intersect with the side surface:
plug in the ray equation into the infinite cylinder
solve for t, (possibly two solutions); choose the
positive solution(s) that satisfy , if any.
2. Intersect with the caps:
intersect with the planes, find t, check if it is
positive; then check if it satisfies
3. From the set of all intersection points (with the
side and caps) if any, choose the one with minimal t.