calculate the distance between every points and it's own group center