1.4 Given two squares on a two dimensional plane, find a line that would cut these two squares in half.
思路很简单,连接两个正方形的中心,线段所在的直线即满足要求。
需要注意,如果两个正方形的中心重合,程序应该考虑到。
SUGGESTIONS AND OBSERVATIONS
The main point of this problem is to see how careful you are about coding. It’s easy to glance
over the special cases (eg, the two squares having the same middle). Make a list of these special
cases before you start the problem and make sure to handle them appropriately.