Maintain the circle and arrays of points.
173288
protected function _updateCircle()
    {
        // Sort the circle
        ksort($this->_circle);

        // Now that the hashes are sorted, generate numeric indices into the
        // circle.
        $this->_pointMap = array_keys($this->_circle);
        $this->_pointCount = count($this->_pointMap);
    }
1034066
def set_points(self, pt1, pt2):
        """"""
        (x1, y1) = pt1.as_tuple()
        (x2, y2) = pt2.as_tuple()
        self.left = min(x1, x2)
        self.top = min(y1, y2)
        self.right = max(x1, x2)
        self.bottom = max(y1, y2)
988553
function () {
    var len = this.points.length
    
    // Check the length of the point buffer
    if (len >= options.batchSize) {  
      // Write the points and log error if any
      client.writePoints(this.points).catch(function (error) {
        console.log(error.message)
      })
      
      // Reset point buffer
      this.points = []
    }
  }
1195611
def update_arc_indexes(geometry, merged_arcs, old_arcs):
    
    if geometry['type'] in ('Point', 'MultiPoint'):
        return

    elif geometry['type'] == 'LineString':
        for arc_index, old_arc in enumerate(geometry['arcs']):
            geometry['arcs'][arc_index] = len(merged_arcs)
            merged_arcs.append(old_arcs[old_arc])

    elif geometry['type'] == 'Polygon':
        for ring in geometry['arcs']:
            for arc_index, old_arc in enumerate(ring):
                ring[arc_index] = len(merged_arcs)
                merged_arcs.append(old_arcs[old_arc])

    elif geometry['type'] == 'MultiLineString':
        for part in geometry['arcs']:
            for arc_index, old_arc in enumerate(part):
                part[arc_index] = len(merged_arcs)
                merged_arcs.append(old_arcs[old_arc])

    elif geometry['type'] == 'MultiPolygon':
        for part in geometry['arcs']:
            for ring in part:
                for arc_index, old_arc in enumerate(ring):
                    ring[arc_index] = len(merged_arcs)
                    merged_arcs.append(old_arcs[old_arc])

    else:
        raise NotImplementedError("Can't do %s geometries" % geometry['type'])
279208
def point(self, x, y):
        """"""
        shapeType = POINT
        pointShape = Shape(shapeType)
        pointShape.points.append([x, y])
        self.shape(pointShape)
1052313
public void setY(float y) {
    	if (y != this.y) {
    		float dy = y - this.y;
	        this.y = y;

	        if ((points == null) || (center == null)) {
	        	checkPoints();
	        }
	        // update the points in the special case
    		for (int i=0;i<points.length/2;i++) {
    			points[(i*2)+1] += dy;
    		}
    		center[1] += dy;
    		y += dy;
    		maxY += dy;
    		minY += dy;
	        trianglesDirty = true;
    	}
    }
664483
protected final void checkPoints() {
        if (pointsDirty) {
            createPoints();
            findCenter();
            calculateRadius();
            
            if (points.length > 0) {
	            maxX = points[0];
	            maxY = points[1];
	            minX = points[0];
	            minY = points[1];
	            for (int i=0;i<points.length/2;i++) {
	            	maxX = Math.max(points[i*2],maxX);
	            	maxY = Math.max(points[(i*2)+1],maxY);
	            	minX = Math.min(points[i*2],minX);
	            	minY = Math.min(points[(i*2)+1],minY);
	            }
            }
            pointsDirty = false;
            trianglesDirty = true;
        }
    }
491662
function removeOverlapPoints(points) {
            var hash = {};
            var ret = [];
            for (var i = 0, l = points.length; i < l; i++) {
                var hashcode = points[i].x * 31 + points[i].y;
                if (!hash[hashcode]) {
                    ret.push(points[i]);
                    hash[hashcode] = 1;
                }
            }
            return ret;
        }
206572
private void backupCoords(Point2d[] dest, IntStack stack) {
        for (int i = 0; i < stack.len; i++) {
            int v = stack.xs[i];
            dest[v].x = atoms[v].getPoint2d().x;
            dest[v].y = atoms[v].getPoint2d().y;
        }
    }
201254
def update_positions(self, positions):
        '''
        '''
        sphs_verts = self.sphs_verts_radii.copy()
        sphs_verts += positions.reshape(self.n_spheres, 1, 3)

        self.tr.update_vertices(sphs_verts)
        self.poslist = positions
405241
private void clearNeighbours( double[][][] houghValues, int x, int y, int radius ) {

        // The following code just clean the points around the center of the circle found.

        double halfRadius = radius / 2.0F;
        double halfSquared = halfRadius * halfRadius;

        int y1 = (int) Math.floor((double) y - halfRadius);
        int y2 = (int) Math.ceil((double) y + halfRadius) + 1;
        int x1 = (int) Math.floor((double) x - halfRadius);
        int x2 = (int) Math.ceil((double) x + halfRadius) + 1;

        if (y1 < 0)
            y1 = 0;
        if (y2 > height)
            y2 = height;
        if (x1 < 0)
            x1 = 0;
        if (x2 > width)
            x2 = width;

        for( int r = radiusMin; r <= radiusMax; r = r + radiusInc ) {
            int indexR = (r - radiusMin) / radiusInc;
            for( int i = y1; i < y2; i++ ) {
                for( int j = x1; j < x2; j++ ) {
                    if (Math.pow(j - x, 2D) + Math.pow(i - y, 2D) < halfSquared) {
                        houghValues[j][i][indexR] = 0.0D;
                    }
                }
            }
        }

    }
260936
public void retainAll(IntBitSet set) {
        int i;

        if (set.data.length > data.length) {
            resize(set.data.length);
        }
        for (i = 0; i < set.data.length; i++) {
            data[i] &= set.data[i];
        }
        for ( ; i < data.length; i++) {
            data[i] = 0;
        }
    }
976913
public void clear()
    {
        DelaunayTriangle t;
        for( int i=0; i<3; i++ )
        {
            t = neighbors[i];
            if( t != null )
            {
                t.clearNeighbor( this );
            }
        }
        clearNeighbors();
        points[0]=points[1]=points[2]=null;
    }
1201760
function createPointObjects(array) {
    if (!array) {
        array = [];
    }

    var acc = array.reduce(function(accumulator, current) {
        if (current.x && current.y) { // Point
            accumulator.push(current);
        }
        else if (current.start && current.end && current.height) { // Arc
            // Consider an arc "flat enough" if its height is < the value times its length
            if (!current.interpolatedPoints) {
                current = new Arc(current.start, current.end, current.height);
            }
            var newPoints = current.interpolatedPoints({relative: 0.1});
            accumulator = accumulator.concat(newPoints);
        }
        else if (current[0] && current[1]) { // x, y pair
            var pt = new Point(current[0], current[1]);
            accumulator.push(pt);
        }
        else {
            debug("don't know how to accommodate", current);
        }
        return accumulator;
    }, []);
    return acc;
}
1090904
def contains_circle(self, pt, radius):
    """"""
    return (self.l < pt.x - radius and self.r > pt.x + radius and
            self.t < pt.y - radius and self.b > pt.y + radius)
400198
private Coordinate[] getCenterPoints( double[][][] houghValues, int maxCircles ) {

        Coordinate[] centerPoints = new Coordinate[maxCircles];
        int xMax = 0;
        int yMax = 0;
        int rMax = 0;

        for( int c = 0; c < maxCircles; c++ ) {
            double counterMax = -1;
            for( int radius = radiusMin; radius <= radiusMax; radius = radius + radiusInc ) {

                int indexR = (radius - radiusMin) / radiusInc;
                for( int y = 0; y < height; y++ ) {
                    for( int x = 0; x < width; x++ ) {
                        if (houghValues[x][y][indexR] > counterMax) {
                            counterMax = houghValues[x][y][indexR];
                            xMax = x;
                            yMax = y;
                            rMax = radius;
                        }
                    }

                }
            }

            centerPoints[c] = new Coordinate(xMax, yMax, rMax);

            clearNeighbours(houghValues, xMax, yMax, rMax);
        }
        return centerPoints;
    }
391416
function() {
            this.objects = [];
            this.map.reset();
            var map = this.map;
            this.map.each(function(val, x, y){
                map.set(x, y, []);
            });
        }