Extra Credit: Class Invariant

So, you may have noticed that that it is possible to make any number of shapes using the Rectangle class. There is no rule in the software that requires the user to input the points on a rectangle. We would call such a rule a class invariant, something that must be mainted at all times by the class. For a point of extra credit, redesign the Rectangle constructor so that if the user puts in 4 points that do not make a rectangle the program throws an Exception.

Remember, you can check if two vectors are perpendicular by checking if their dot product is zero. More information on the dot product can be found here.