Create circle element, based on ellipse
162068
function(size) {
      return this.put(new SVG.Circle).rx(new SVG.Number(size).divide(2)).move(0, 0)
    }
1249332
def _draw_ellipse(data, obj, draw_options):
    
    if isinstance(obj, mpl.patches.Circle):
        # circle specialization
        return _draw_circle(data, obj, draw_options)
    x, y = obj.center
    ff = data["float format"]

    if obj.angle != 0:
        fmt = "rotate around={{" + ff + ":(axis cs:" + ff + "," + ff + ")}}"
        draw_options.append(fmt.format(obj.angle, x, y))

    cont = (
        "\\draw[{}] (axis cs:"
        + ff
        + ","
        + ff
        + ") ellipse ("
        + ff
        + " and "
        + ff
        + ");\n"
    ).format(",".join(draw_options), x, y, 0.5 * obj.width, 0.5 * obj.height)
    return data, cont
614941
private void calculateCircleOval() {
        Rect contentRect = computator.getContentRectMinusAllMargins();
        final float circleRadius = Math.min(contentRect.width() / 2f, contentRect.height() / 2f);
        final float centerX = contentRect.centerX();
        final float centerY = contentRect.centerY();
        final float left = centerX - circleRadius + touchAdditional;
        final float top = centerY - circleRadius + touchAdditional;
        final float right = centerX + circleRadius - touchAdditional;
        final float bottom = centerY + circleRadius - touchAdditional;
        originCircleOval.set(left, top, right, bottom);
        final float inest = 0.5f * originCircleOval.width() * (1.0f - circleFillRatio);
        originCircleOval.inset(inest, inest);
    }
585287
function ( e )
	{
		var that = this;

		if ( this.dom.drag === null )
		{
			/* Only create the drag element if the mouse has moved a specific distance from the start
			 * point - this allows the user to make small mouse movements when sorting and not have a
			 * possibly confusing drag element showing up
			 */
			if ( Math.pow(
				Math.pow(e.pageX - this.s.mouse.startX, 2) +
				Math.pow(e.pageY - this.s.mouse.startY, 2), 0.5 ) < 5 )
			{
				return;
			}
			this._fnCreateDragNode();
		}

		/* Position the element - we respect where in the element the click occured */
		this.dom.drag.css( {
			left: e.pageX - this.s.mouse.offsetX,
			top: e.pageY - this.s.mouse.offsetY
		} );

		/* Based on the current mouse position, calculate where the insert should go */
		var bSet = false;
		var lastToIndex = this.s.mouse.toIndex;

		for ( var i=1, iLen=this.s.aoTargets.length ; i<iLen ; i++ )
		{
			if ( e.pageX < this.s.aoTargets[i-1].x + ((this.s.aoTargets[i].x-this.s.aoTargets[i-1].x)/2) )
			{
				this.dom.pointer.css( 'left', this.s.aoTargets[i-1].x );
				this.s.mouse.toIndex = this.s.aoTargets[i-1].to;
				bSet = true;
				break;
			}
		}

		// The insert element wasn't positioned in the array (less than
		// operator), so we put it at the end
		if ( !bSet )
		{
			this.dom.pointer.css( 'left', this.s.aoTargets[this.s.aoTargets.length-1].x );
			this.s.mouse.toIndex = this.s.aoTargets[this.s.aoTargets.length-1].to;
		}

		// Perform reordering if realtime updating is on and the column has moved
		if ( this.s.init.bRealtime && lastToIndex !== this.s.mouse.toIndex ) {
			this.s.dt.oInstance.fnColReorder( this.s.mouse.fromIndex, this.s.mouse.toIndex );
			this.s.mouse.fromIndex = this.s.mouse.toIndex;
			this._fnRegions();
		}
	}
91049
def diam_circle(AreaCircle):
    """"""
    ut.check_range([AreaCircle, ">0", "AreaCircle"])
    return np.sqrt(4 * AreaCircle / np.pi)
1048461
def circle(self, cx, cy, r, stroke=None, fill=None, stroke_width=1):
        
        self.put(' <circle cx="')
        self.put(str(cx))
        self.put('" cy="')
        self.put(str(cy))
        self.put('" r="')
        self.put(str(r))
        self.put('" stroke-width="')
        self.put(str(stroke_width))
        self.put('"')
        if fill:
            self.put(' fill="')
            self.put(fill)
            self.put('"')
        if stroke:
            self.put(' stroke="')
            self.put(stroke)
            self.put('"')
        self.put('/>\n')
830793
def ellipse(center,covariance_matrix,level=1, n=1000):
    """"""
    # singular value decomposition
    U, s, rotation_matrix = N.linalg.svd(covariance_matrix)
    # semi-axes (largest first)

    saxes = N.sqrt(s)*level ## If the _area_ of a 2s ellipse is twice that of a 1s ellipse
    # If the _axes_ are supposed to be twice as long, then it should be N.sqrt(s)*width

    u = N.linspace(0, 2*N.pi, n)
    data = N.column_stack((saxes[0]*N.cos(u), saxes[1]*N.sin(u)))
    # rotate data
    return N.dot(data, rotation_matrix)+ center
659106
function() {
        var cone = new Cone$1({
            topRadius: this.radius,
            bottomRadius: this.radius,
            capSegments: this.capSegments,
            heightSegments: this.heightSegments,
            height: this.height
        });

        this.attributes.position.value = cone.attributes.position.value;
        this.attributes.normal.value = cone.attributes.normal.value;
        this.attributes.texcoord0.value = cone.attributes.texcoord0.value;
        this.indices = cone.indices;

        this.boundingBox = cone.boundingBox;
    }
626769
public function ellipse($x, $y, $rx, $ry, $style = 'D')
    {
        if ($style == 'F') {
            $op = 'f';
        } elseif ($style == 'FD' || $style == 'DF') {
            $op = 'B';
        } else {
            $op = 'S';
        }
        $lx = 4 / 3 * (M_SQRT2 - 1) * $rx;
        $ly = 4 / 3 * (M_SQRT2 - 1) * $ry;
        $k = $this->k;
        $h = $this->h;
        $this->out(
            sprintf(
                '%.2F %.2F m %.2F %.2F %.2F %.2F %.2F %.2F c',
                ($x + $rx) * $k,
                ($h - $y) * $k,
                ($x + $rx) * $k,
                ($h - ($y - $ly)) * $k,
                ($x + $lx) * $k,
                ($h - ($y - $ry)) * $k,
                $x * $k,
                ($h - ($y - $ry)) * $k
            )
        );

        $this->out(
            sprintf(
                '%.2F %.2F %.2F %.2F %.2F %.2F c',
                ($x - $lx) * $k,
                ($h - ($y - $ry)) * $k,
                ($x - $rx) * $k,
                ($h - ($y - $ly)) * $k,
                ($x - $rx) * $k,
                ($h - $y) * $k
            )
        );

        $this->out(
            sprintf(
                '%.2F %.2F %.2F %.2F %.2F %.2F c',
                ($x - $rx) * $k,
                ($h - ($y + $ly)) * $k,
                ($x - $lx) * $k,
                ($h - ($y + $ry)) * $k,
                $x * $k,
                ($h - ($y + $ry)) * $k
            )
        );

        $this->out(
            sprintf(
                '%.2F %.2F %.2F %.2F %.2F %.2F c %s',
                ($x + $lx) * $k,
                ($h - ($y + $ry)) * $k,
                ($x + $rx) * $k,
                ($h - ($y + $ly)) * $k,
                ($x + $rx) * $k,
                ($h - $y) * $k,
                $op
            )
        );
    }
353208
def prox_circle(xy, step):
    """"""
    center = np.array([0,0])
    dxy = xy - center
    radius = 0.5
    # exclude interior of circle
    #if (dxy**2).sum() < radius**2:
    # exclude everything other than perimeter of circle
    if 1:
        phi = np.arctan2(dxy[1], dxy[0])
        return center + radius*np.array([np.cos(phi), np.sin(phi)])
    else:
        return xy
615049
function createNoGoCircleSpecialAttractors(x, y, radius, impactDistance, type, direction) {
  var circleSubDiv = radius * SUBDIVISE_NOGO / 20;
  for( var i = 0; i < circleSubDiv; i++ ) {
    var specialAttractor = {};
    specialAttractor.x1 = (x + radius * Math.cos(2*Math.PI / circleSubDiv * i)) * pixelRatio;
    specialAttractor.y1 = (y + radius * Math.sin(2*Math.PI / circleSubDiv * i)) * pixelRatio;
    specialAttractor.x2 = (x + radius * Math.cos(2*Math.PI / circleSubDiv * (i+1))) * pixelRatio;
    specialAttractor.y2 = (y + radius * Math.sin(2*Math.PI / circleSubDiv * (i+1))) * pixelRatio;
    specialAttractor.impactDistance = impactDistance * pixelRatio;
    specialAttractor.type = type;
    specialAttractor.direction = direction;
    specialAttractors.push(specialAttractor);
    if(DEBUG_FLAG) {
      drawHelperCircle(specialAttractor.x1, specialAttractor.y1, 1);
    }
  }

  var bbox = {
    topLeft: {
      x: (x - radius) * pixelRatio,
      y: (y - radius) * pixelRatio,
    },
    bottomRight: {
      x: (x + radius) * pixelRatio,
      y: (y + radius) * pixelRatio,
    },
  };

  specialAttractorsBoundingBoxes.push(bbox);
  noGoBBoxes.push(bbox);
}
625066
public function circle($x, $y, $r, $style = 'D')
    {
        $this->Ellipse($x, $y, $r, $r, $style);
    }
10638
function(object) {

      var groupLeft = this.get('left'),
          groupTop = this.get('top'),
          groupAngle = this.getAngle() * (Math.PI / 180),
          objectLeft = object.get('originalLeft'),
          objectTop = object.get('originalTop'),
          rotatedTop = Math.cos(groupAngle) * object.get('top') + Math.sin(groupAngle) * object.get('left'),
          rotatedLeft = -Math.sin(groupAngle) * object.get('top') + Math.cos(groupAngle) * object.get('left');

      object.setAngle(object.getAngle() + this.getAngle());

      object.set('left', groupLeft + rotatedLeft * this.get('scaleX'));
      object.set('top', groupTop + rotatedTop * this.get('scaleY'));

      object.set('scaleX', object.get('scaleX') * this.get('scaleX'));
      object.set('scaleY', object.get('scaleY') * this.get('scaleY'));

      object.setCoords();
      object.hideCorners = false;
      object.setActive(false);
      object.setCoords();

      return this;
    }
69524
def get_bezier_ellipse(x, y, xradius, yradius, kappa=0.5522848):
    """"""

    xs, ys = x - xradius, y - yradius
    ox, oy = xradius * kappa, yradius * kappa
    xe, ye = x + xradius, y + yradius

    pts = [(xs, y),
           (xs, y - oy), (x - ox, ys), (x, ys),
           (x + ox, ys), (xe, y - oy), (xe, y),
           (xe, y + oy), (x + ox, ye), (x, ye),
           (x - ox, ye), (xs, y + oy), (xs, y)]
    return pts
731386
function (imageOptions) {

		imageOptions = imageOptions || {};

		var patternGuid = L.Util.guid();

		var radius = this.options.radius || Math.max(this.options.radiusX, this.options.radiusY);
		var diameter = this._getDefaultDiameter(radius);
		var imageSize = imageOptions.imageSize || new L.Point(diameter, diameter);

		var circleSize = imageOptions.radius || diameter/2;

		var shapeOptions = imageOptions.shape || {
			circle: {
				r: circleSize,
				cx: 0,
				cy: 0
			}
		};

		var patternOptions = imageOptions.pattern || {
			width: imageSize.x,
			height: imageSize.y,
			x: 0,
			y: 0
		};

		var shapeKeys = Object.keys(shapeOptions);
		var shapeType = shapeKeys.length > 0 ? shapeKeys[0] : 'circle';

		shapeOptions[shapeType].fill = 'url(#' + patternGuid + ')';

		var shape = this._createShape(shapeType, shapeOptions[shapeType]);

		if (this.options.clickable) {
			shape.setAttribute('class', 'leaflet-clickable');
		}

		patternOptions.id = patternGuid;
		patternOptions.patternUnits = patternOptions.patternUnits || 'objectBoundingBox';

		var pattern = this._createPattern(patternOptions);

		imageOptions = imageOptions.image || {
			width: imageSize.x,
			height: imageSize.y,
			x: 0,
			y: 0,
			url: this.options.imageCircleUrl
		};

		var image = this._createImage(imageOptions);
        image.setAttributeNS(L.Path.XLINK_NS, 'xlink:href', imageOptions.url);

		pattern.appendChild(image);
		this._defs.appendChild(pattern);
		this._container.insertBefore(shape, this._defs);

		this._shape = shape;
		
		var me = this;
		
		this._shape.addEventListener('mouseover', function () {
			me.fire('mouseover');
		});
		
		this._shape.addEventListener('mouseout', function () {
			me.fire('mouseout');
		});
		
		this._shape.addEventListener('mousemove', function () {
			me.fire('mousemove');
		});
		
		var anchorPoint = this.getTextAnchor();

		if (this._shape && anchorPoint) {
			if (this._shape.tagName === 'circle' || this._shape.tagName === 'ellipse') {
				this._shape.setAttribute('cx', anchorPoint.x);
				this._shape.setAttribute('cy', anchorPoint.y);
			}
			else {
				var width = this._shape.getAttribute('width');
				var height = this._shape.getAttribute('height');
				this._shape.setAttribute('x', anchorPoint.x - Number(width)/2);
				this._shape.setAttribute('y', anchorPoint.y - Number(height)/2);
			}
		}
	}
708530
function() {

            var self = this;

            // calculate the location and offset.

            // the largest rectangle that can be inscribed in a 
            // circle is a square.

            // calculate the offset for the center of the chart.
            var offset = $('#' + self.getGenericId('svg')).offset();
            var top = offset['top'] + self.options.diameter / 2;
            var left = offset['left'] + self.options.diameter / 2;

            // the center circle's the diameter is a third of the 
            // self.options.diameter.
            var centerRadius = self.options.diameter / 6;
            var squareX = Math.sqrt(centerRadius * centerRadius / 2);

            // top and left for the explanation div.
            top = top - squareX;
            left = left - squareX - 25;

            // the main explanation div.
            $('#' + self.getGenericId('explanation'))
              .css('position', 'absolute')
              .css('text-align', 'center')
              // The z-index property specifies the z-order of a 
              // positioned element and its descendants. 
              // When elements overlap, z-order determines 
              // which one covers the other. 
              // An element with a larger z-index 
              // generally covers an element with a lower one.
              // FIXME: seems we need use class to utilize the 
              // -1 z-index, which will help position 
              // the explanation div under the circle.
              .css('z-index', '-1')
              // it turns out the bootstrap panel has something
              // to do with the z-index.
              // In general the z-index should work fine.
              //.attr('class', 'bs-explanation')
              // set the border, most time is for debugging..
              .css('border', '0px solid black')
              .css('width', '180px')
              .css('top', top + 'px')
              .css('left', left + 'px');

            $('#' + self.getGenericId('pageviews'))
              .css('font-size', '2.5em')
              .css('color', '#316395');

            $('#' + self.getGenericId('percentage'))
              .css('font-size', '1.5em')
              .css('color', '#316395');

            $('#' + self.getGenericId('date'))
              .css('font-weight', 'bold');

            $('#' + self.getGenericId('group'))
              .css('font-weight', 'bold');
        }
350680
def layout_circle(self):
    ''''''
    n = self.num_vertices()
    t = np.linspace(0, 2*np.pi, n+1)[:n]
    return np.column_stack((np.cos(t), np.sin(t)))