Computes the centroid of set of points

    Args:
        points (:obj:`list` of :obj:`Point`)
    Returns:
        :obj:`Point`
328438
def compute_centroid(points):
    
    lats = [p[1] for p in points]
    lons = [p[0] for p in points]
    return Point(np.mean(lats), np.mean(lons), None)
586172
def center(self):
        ''''''
        points = np.array(self._points)
        return np.mean(points[:, COLS.XYZ], axis=0)
647646
def points(self):
        ''''''
        if self._points is None:
            _points = self.soma.points.tolist()
            for n in self.neurites:
                _points.extend(n.points.tolist())
            self._points = np.array(_points)

        return self._points
851510
def points(self, points):
        
        if not isinstance(points, np.ndarray):
            raise TypeError('Points must be a numpy array')
        # get the unique coordinates along each axial direction
        x = np.unique(points[:,0])
        y = np.unique(points[:,1])
        z = np.unique(points[:,2])
        nx, ny, nz = len(x), len(y), len(z)
        # TODO: this needs to be tested (unique might return a tuple)
        dx, dy, dz = np.unique(np.diff(x)), np.unique(np.diff(y)), np.unique(np.diff(z))
        ox, oy, oz = np.min(x), np.min(y), np.min(z)
        # Build the vtk object
        self._from_specs((nx,ny,nz), (dx,dy,dz), (ox,oy,oz))
        #self._point_ref = points
        self.Modified()
358906
def _scalePoints(points, scale=1, convertToInteger=True):
    
    if convertToInteger:
        points = [
            (int(round(x * scale)), int(round(y * scale)))
            for (x, y) in points
        ]
    else:
        points = [(x * scale, y * scale) for (x, y) in points]
    return points
1173623
def clean_points(points):
    
    if not points:
        return points

    result = [points[0]]
    for point in points:
        if point != result[-1]:
            result.append(point)
    return result
692075
def start_point(self):
        
        edge = self.result.wire().val().Edges()[0]
        return edge.Vertices()[0].Center()
781270
public JTSPointExpression<Point> centroid() {
        if (centroid == null) {
            centroid = JTSGeometryExpressions.pointOperation(SpatialOps.CENTROID, mixin);
        }
        return centroid;
    }
1224670
def point_arrays(self):
        
        pdata = self.GetPointData()
        narr = pdata.GetNumberOfArrays()

        # Update data if necessary
        if hasattr(self, '_point_arrays'):
            keys = list(self._point_arrays.keys())
            if narr == len(keys):
                if keys:
                    if self._point_arrays[keys[0]].size == self.n_points:
                        return self._point_arrays
                else:
                    return self._point_arrays

        # dictionary with callbacks
        self._point_arrays = PointScalarsDict(self)

        for i in range(narr):
            name = pdata.GetArrayName(i)
            self._point_arrays[name] = self._point_scalar(name)

        self._point_arrays.enable_callback()
        return self._point_arrays
1131746
def center(self):
        '''
        
        '''
        return Point(self.midX, self.midY, self.origin.z)
643134
def points(self):
        
        x = vtk_to_numpy(self.GetXCoordinates())
        y = vtk_to_numpy(self.GetYCoordinates())
        z = vtk_to_numpy(self.GetZCoordinates())
        xx, yy, zz = np.meshgrid(x,y,z, indexing='ij')
        return np.c_[xx.ravel(), yy.ravel(), zz.ravel()]
1347371
public static KmeansPoint calculateCentroid(List<KmeansPoint> basePoints)
    {
        double[] firstDataPoint = basePoints.get(0).getDataPoint();
        double[] centroidSum = Arrays.copyOf(firstDataPoint, firstDataPoint.length);

        for (int pointIndex = 1; pointIndex < basePoints.size(); pointIndex++)
        {
            for (int coordinateIndex = 0; coordinateIndex < centroidSum.length; coordinateIndex++)
            {
                centroidSum[coordinateIndex] = centroidSum[coordinateIndex]
                        + basePoints.get(pointIndex).getDataPoint()[coordinateIndex];
            }
        }

        double[] centroidPoints = sub(centroidSum, basePoints.size());
        KmeansPoint centroid = new KmeansPoint();
        centroid.setDataPoint(centroidPoints);
        return centroid;
    }
1192299
def get_points(self):
        
        if hasattr(self, 'points'):
            points = self.crdmap.to_data(self.points)
        else:
            points = []
        return points
611302
function parsePoints(points) {
    var coord = this._coord;
    var rst = [];
    Util.each(points, function (point) {
      rst.push(coord.convertPoint(point));
    });
    return rst;
  }
780567
def getPoints(self, pared=False):
        
        points = self._points[:]
        if pared:
            np = NodePare()
            np.addPoints(points)
            np.parePoints()
            points = np.getParedPoints()

        return points
1267689
function pointsToCoordArray(points) {
                var coodinatesArray = new Array(points.length * points[0].length);
                var k = 0;
                for (var i = 0; i < points.length; ++i) {
                    for (var j = 0; j < points[0].length; ++j) {
                        coodinatesArray[k] = points[i][j];
                        ++k;
                    }
                }

                return coodinatesArray;
            }
502777
def search_point(self, point, result):
        
        for k in self.s_center:
            if k.begin <= point < k.end:
                result.add(k)
        if point < self.x_center and self[0]:
            return self[0].search_point(point, result)
        elif point > self.x_center and self[1]:
            return self[1].search_point(point, result)
        return result