Get the center of mass of actor.

        .. hint:: |fatlimb| |fatlimb.py|_
512107
def centerOfMass(self):
        
        cmf = vtk.vtkCenterOfMass()
        cmf.SetInputData(self.polydata(True))
        cmf.Update()
        c = cmf.GetCenter()
        return np.array(c)
262534
def _scene_centroid(self):
        
        ul_lat = self.corner_ul_lat_product
        ll_lat = self.corner_ll_lat_product
        ul_lon = self.corner_ul_lon_product
        ur_lon = self.corner_ur_lon_product
        lat = (ul_lat + ll_lat) / 2.
        lon = (ul_lon + ur_lon) / 2.

        return lat, lon
1344356
def _get_nsymop(self):
        """"""
        if self.centrosymmetric:
            return 2 * len(self._rotations) * len(self._subtrans)
        else:
            return len(self._rotations) * len(self._subtrans)
1126194
def center(self):
        '''
        
        '''
        try:
            return self._center
        except AttributeError:
            pass
        self._center = Point()
        return self._center
897039
def calculate_centre_of_mass(self):
        
        self.centre_of_mass = center_of_mass(self.elements, self.coordinates)
        self.properties['centre_of_mass'] = self.centre_of_mass
        return self.centre_of_mass
1361570
def center(self):
        

        if np.all(np.isfinite(self.xyz)):
            return np.mean(self.xyz, axis=0)
665545
def D(self):
        '''
        
        '''
        return Point(self.minX, self.maxY, self.origin.z)
754958
def centroid(im):
    
    # These calls point to Python version of moments function
    m00 = cdriz.arrmoments(im,0,0)
    m10 = cdriz.arrmoments(im, 1,0)
    m01 = cdriz.arrmoments(im,0,1)

    ycen = m10 / m00
    xcen = m01 / m00
    return xcen, ycen
1347660
function findLargestInCol (M, i, startAtRow = 0) {
  let me = M.elements;
  let n = M.dimension;
  let offset = i * n;
  let maxIdx = startAtRow;
  let maxVal = _Math.abs(me[offset + maxIdx]);
  for (let i = maxIdx + 1; i < n; ++i) {
    let val = _Math.abs(me[offset + i]);
    if (val > maxVal) {
      maxIdx = i;
      maxVal = val;
    }
  }
  return maxIdx;
}
1219122
def center(a: Union[Set["Point2"], List["Point2"]]) -> "Point2":
        
        s = Point2((0, 0))
        for p in a:
            s += p
        return s / len(a)
147046
def com_find(ar_grid):
    
    f_x = 0
    f_y = 0
    f_m = 0

    for i in range(len(ar_grid)):
       for j in range(len(ar_grid[i])):
         if ar_grid[i][j]:
            # Since python arrays are zero indexed, we need to offset
            # the loop counters by 1 to account for mass in the 1st
            # column.
            f_x += (j+1) * ar_grid[i][j]
            f_y += (i+1) * ar_grid[i][j]
            f_m += ar_grid[i][j]
    f_com = array( (float(f_x)/f_m , float(f_y)/f_m) )
    return f_com
502744
def center_of_mass(self, time):
        
        if self.start_time <= time <= self.end_time:
            diff = time - self.start_time
            valid = np.flatnonzero(self.masks[diff] != 0)
            if valid.size > 0:
                com_x = 1.0 / self.timesteps[diff].ravel()[valid].sum() * np.sum(self.timesteps[diff].ravel()[valid] *
                                                                                 self.x[diff].ravel()[valid])
                com_y = 1.0 / self.timesteps[diff].ravel()[valid].sum() * np.sum(self.timesteps[diff].ravel()[valid] *
                                                                                 self.y[diff].ravel()[valid])
            else:
                com_x = np.mean(self.x[diff])
                com_y = np.mean(self.y[diff])
        else:
            com_x = None
            com_y = None
        return com_x, com_y
1168681
def centre(self):
        """"""
        return self.p2s(self.canvasx(self.width / 2.0)), self.p2s(self.canvasy(self.height / 2.0))
1317380
def project(self, X, Q=None):
        
        if Q is None:
            Q = self.Q
        if Q > X.shape[1]:
            raise IndexError("requested dimension larger then input dimension")
        X = self.center(X)
        return X.dot(self.eigvectors[:, :Q])
292913
protected void findCenter() {
        center = new float[]{0, 0};
        int length = points.length;
        for(int i=0;i<length;i+=2) {
            center[0] += points[i];
            center[1] += points[i + 1];
        }
        center[0] /= (length / 2);
        center[1] /= (length / 2);
    }
98007
def center(self, weights=None):
        
        if weights is None:
            weights = self.data.weights
        mass = utils.bincount(self.labels, weights, self.N)
        cp = numpy.empty((len(mass), self.data.pos.shape[-1]), 'f8')
        for d in range(self.data.pos.shape[-1]):
            cp[..., d] = utils.bincount(self.labels, weights *
                    self.data.pos[..., d], self.N)
            cp[..., d] /= mass
        return cp
1131746
def center(self):
        '''
        
        '''
        return Point(self.midX, self.midY, self.origin.z)