return list of geo points from circle with given center and radius
        :param center_point: GeoPoint with center of search circle
        :param radius: radius of search circle
        :return: generator with tuple with GeoPoints and distance
5496
def get_nearest_points(self, center_point, radius, unit='km'):
        
        assert isinstance(center_point, GeoPoint), \
            'point should be GeoPoint instance'
        for point in self.get_nearest_points_dirty(center_point, radius):
            distance = point.distance_to(center_point, unit)
            if distance <= radius:
                yield point, distance
715927
def _map_center(self, coord, val):
        '''  '''

        if self.ppd in [4, 8, 16, 32, 64]:
            res = {'lat': 0, 'long': 360}
            return res[coord] / 2.0
        elif self.ppd in [128]:
            res = {'lat': 90, 'long': 90}
            return (val // res[coord] + 1) * res[coord] - res[coord] / 2.0
        elif self.ppd in [256]:
            res = {'lat': 60, 'long': 90}
            return (val // res[coord] + 1) * res[coord] - res[coord] / 2.0
520652
def get_center(self):
        
        dist = self.get_distance()
        diff = self.get_diff()
        direction = diff / dist

        center_x = self.p2_x + (dist * 0.5) * direction[0]
        center_y = self.p2_y + (dist * 0.5) * direction[1]

        return np.array([center_x, center_y])
729439
def cmd_center(self, args):
        ''''''
        if len(args) < 3:
            print("map center LAT LON")
            return
        lat = float(args[1])
        lon = float(args[2])
        self.map.set_center(lat, lon)
65782
def radius(self):
        '''
        
        '''
        try:
            return self._radius
        except AttributeError:
            pass
        self._radius = Point(1, 1, 0)
        return self._radius
32763
public static Point getCorner (Point center, Point size)
    {
        return new Point(center.x - size.x/2, center.y - size.y/2);
    }
1039578
def concentric_circles_path(size):
    
    width, height = size
    x0, y0 = width // 2, height // 2
    max_radius = int(sqrt(2) * max(height, width))
    yield from fill_concentric_circles(radius=max_radius, center=(x0, y0), size=size)
638042
def central_vertices(self):
        """"""
        max_distances = self.distances.max(0)
        max_distances_min = max_distances[max_distances > 0].min()
        return (max_distances == max_distances_min).nonzero()[0]
1360446
def point_in_circle(pt, center, radius):
    '''
    
    '''
    d = np.linalg.norm(np.asarray(pt) - np.asarray(center))
    return d <= radius
1089189
def get_points(recording):
    
    points = []
    for stroke in recording:
        point = geometry.get_bounding_box(stroke).get_center()
        points.append(point)
    return points
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)
1038977
def points_on_circle(radius, points):
    
    angle = np.linspace(0, 2*np.pi, points)
    x_coord = np.cos(angle)*radius
    y_coord = np.sin(angle)*radius
    return x_coord, y_coord
783632
public static Point getCircumCenter(Geometry geometry) {
        if(geometry == null || geometry.getNumPoints() == 0) {
            return null;
        }
        return geometry.getFactory().createPoint(new MinimumBoundingCircle(geometry).getCentre());
    }
288501
def point_within_radius(self, points, pt, canvas_radius,
                            scales=(1.0, 1.0)):
        
        scale_x, scale_y = scales
        x, y = pt
        a_arr, b_arr = np.asarray(points).T
        dx = np.fabs(x - a_arr) * scale_x
        dy = np.fabs(y - b_arr) * scale_y
        new_radius = np.sqrt(dx**2 + dy**2)
        res = (new_radius <= canvas_radius)
        return res
979504
function chooseInitialCenters(points) {

    // Convert to list for indexed access. Make it unmodifiable, since removal of items
    // would screw up the logic of this method.
    var pointList = points;
    // The number of points in the list.
    var numPoints = pointList.length;

    // Set the corresponding element in this array to indicate when
    // elements of pointList are no longer available.
    var taken = new Array(numPoints);
    for (var i = 0; i < taken.length; i++) {
      taken[i] = false;
    }

    // The resulting list of initial centers.
    var resultSet = [];

    // Choose one center uniformly at random from among the data points.
    var firstPointIndex = nextInt(numPoints);
    var firstPoint = pointList[firstPointIndex];
    resultSet.push(new CentroidCluster(firstPoint));
    // Must mark it as taken
    taken[firstPointIndex] = true;

    // To keep track of the minimum distance squared of elements of
    // pointList to elements of resultSet.

    var minDistSquared = new Float32Array(numPoints);

    // Initialize the elements.  Since the only point in resultSet is firstPoint,
    // this is very easy.
    for (var i = 0; i < numPoints; i++) {
      if (i !== firstPointIndex) { // That point isn't considered
        var d = distance(firstPoint, pointList[i]);
        minDistSquared[i] = d * d;
      }
    }

    while (resultSet.length < k) {
      // Sum up the squared distances for the points in pointList not
      // already taken.
      var distSqSum = 0.0;

      for (var i = 0; i < numPoints; i++) {
        if (!taken[i]) {
          distSqSum += minDistSquared[i];
        }
      }

      // Add one new data point as a center. Each point x is chosen with
      // probability proportional to D(x)2
      var r = nextDouble() * distSqSum;

      // The index of the next point to be added to the resultSet.
      var nextPointIndex = -1;

      // Sum through the squared min distances again, stopping when
      // sum >= r.
      var sum = 0.0;
      for (var i = 0; i < numPoints; i++) {
        if (!taken[i]) {
          sum += minDistSquared[i];
          if (sum >= r) {
            nextPointIndex = i;
            break;
          }
        }
      }

      // If it's not set to >= 0, the point wasn't found in the previous
      // for loop, probably because distances are extremely small.  Just pick
      // the last available point.
      if (nextPointIndex === -1) {
        for (var i = numPoints - 1; i >= 0; i--) {
          if (!taken[i]) {
            nextPointIndex = i;
            break;
          }
        }
      }

      // We found one.
      if (nextPointIndex >= 0) {

        var p = pointList[nextPointIndex];

        resultSet.push(new CentroidCluster(p));

        // Mark it as taken.
        taken[nextPointIndex] = true;

        if (resultSet.length < k) {
          // Now update elements of minDistSquared.  We only have to compute
          // the distance to the new center to do this.
          for (var j = 0; j < numPoints; j++) {
            // Only have to worry about the points still not taken.
            if (!taken[j]) {
              var d = distance(p, pointList[j]);
              var d2 = d * d;
              if (d2 < minDistSquared[j]) {
                minDistSquared[j] = d2;
              }
            }
          }
        }

      } else {
        // None found --
        // Break from the while loop to prevent
        // an infinite loop.
        break;
      }
    }
    return resultSet;
  }
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
1158504
function getCenter(points) {
        var center = {x: 0, y: 0};
        for (var i =0; i < points.length; ++i ) {
            center.x += points[i].x;
            center.y += points[i].y;
        }
        center.x /= points.length;
        center.y /= points.length;
        return center;
    }