The ``(y, x)`` coordinate, relative to the `data_cutout`, of
        the centroid within the source segment.
500649
def cutout_centroid(self):
        

        m = self.moments
        if m[0, 0] != 0:
            ycentroid = m[1, 0] / m[0, 0]
            xcentroid = m[0, 1] / m[0, 0]
            return (ycentroid, xcentroid) * u.pix
        else:
            return (np.nan, np.nan) * u.pix
1165464
function(x, y) {
        // clear cached center location
        this.centerLonLat = null;

        if ((this.left == null) || (x < this.left)) {
            this.left = x;
        }
        if ((this.bottom == null) || (y < this.bottom)) {
            this.bottom = y;
        }
        if ((this.right == null) || (x > this.right)) {
            this.right = x;
        }
        if ((this.top == null) || (y > this.top)) {
            this.top = y;
        }
    }
152547
def centroid(self):
        '''
        

        '''
        if self.v is None:
            raise ValueError('Mesh has no vertices; centroid is not defined')

        return np.mean(self.v, axis=0)
958945
def background_at_centroid(self):
        

        from scipy.ndimage import map_coordinates

        if self._background is not None:
            # centroid can still be NaN if all data values are <= 0
            if (self._is_completely_masked or
                    np.any(~np.isfinite(self.centroid))):
                return np.nan * self._background_unit  # unit for table
            else:
                value = map_coordinates(self._background,
                                        [[self.ycentroid.value],
                                         [self.xcentroid.value]], order=1,
                                        mode='nearest')[0]

                return value * self._background_unit
        else:
            return None
638859
def rectangle_centroid(rectangle):
    
    bbox = rectangle['coordinates'][0]
    xmin = bbox[0][0]
    ymin = bbox[0][1]
    xmax = bbox[2][0]
    ymax = bbox[2][1]
    xwidth = xmax - xmin
    ywidth = ymax - ymin
    return {'type': 'Point', 'coordinates': [xmin + xwidth / 2, ymin + ywidth / 2]}
821190
def centroid(X):
    
    C = np.sum(X, axis=0) / len(X)
    return C
1219742
def centerOn(self, point):
        
        rect = self.rect()
        x = point.x() - rect.width() / 2.0
        y = point.y() - rect.height() / 2.0
        
        self.setPos(x, y)
131906
def center_of_mass(X, Y):
    
    X = np.asarray(X)
    Y = np.asarray(Y)
    return (X * Y).sum() / Y.sum()
186008
def image_coordinates(self, point):
        ''''''
        # the dragpos is the top left position in image coordinates
        ret = wx.Point(int(self.dragpos.x + point.x/self.zoom),
                       int(self.dragpos.y + point.y/self.zoom))
        return ret
512107
def centerOfMass(self):
        
        cmf = vtk.vtkCenterOfMass()
        cmf.SetInputData(self.polydata(True))
        cmf.Update()
        c = cmf.GetCenter()
        return np.array(c)
365646
function( pointA, pointB ) {

	        return { x: pointB.x - pointA.x, y: -( pointB.y - pointA.y ) };
	    }
1339931
function coordinates(index, source) {
    if (!index || !source)
        return void 0;

    var lines = source
            .slice(0, index)
            .split('\n');

    return lines.length + ':' + lines.pop().length;
}
622276
def get_center(self):
        
        return Point((self.p1.x+self.p2.x)/2.0, (self.p1.y+self.p2.y)/2.0)
1017610
def center_blit(target, source, dest = (0, 0), area=None, special_flags=0):
    '''
    
    '''
    loc = lambda d, s: _vec(d.get_size()) / 2 - _vec(s.get_size()) / 2
    _blitter(loc, target, source, dest, area, special_flags)
1270332
def center_at(self, x, y):
        """"""

        self.x = x - (self.width / 2)
        self.y = y - (self.height / 2)
918427
def centroid(self):
        
        left, bottom, right, top = self.lbrt()
        return (right + left) / 2.0, (top + bottom) / 2.0
1120384
def coordinates(self, x, y):
        ''''''
        state = self.state
        return state.mt.coord_from_area(x, y, state.lat, state.lon, state.width, state.ground_width)