Add a method for determining if a line intersects a rectangle.