Added midpoint and distance functions for CGPoint.