Solving RubyQuiz #233, in Python. http://rubyquiz.strd6.com/quizzes/233-geometric-intersections