distance between 2 points and (a+b)2