Scala code to determine if two rectangles intersect.