The average distance between points on a square