Added error when calling angle2() with a dimension not equal to 2.

Also checking that the two points are of equal dimension.