public Point makeGravityCenter() {
        
        int dim = getDim();
        Double[] coordsG = new Double[dim];
        for (int i = 0; i < dim; ++i) coordsG[i] = 0d;
        
        // calculate the means of Points' coordinates
        for (Point p:points) {
            for (int i = 0; i < dim; ++i) {
                coordsG[i] += p.getCoord(i);
            }
        }
        for (int i = 0; i < dim; ++i) {
            coordsG[i] = coordsG[i] / (double) points.size();
        }
        
        Point newCenter = new Point(coordsG);
        this.center = newCenter;
        newCenter.setCluster(this);
        
        return newCenter;
    }