Retrieves a tuple with the x,y coordinates of the upper right point of the ellipse. 
        Requires the radius and the coordinates to be numbers
174554
def getTopRight(self):
        
        return (float(self.get_cx()) + float(self.get_rx()), float(self.get_cy()) + float(self.get_ry()))
455656
def getP1(self):
        
        return Point(self.center[0] - self.radius,
                     self.center[1] - self.radius)
616674
def bullseye_position(self) -> typing.Tuple[float, float]:
        
        return self.bullseye_x, self.bullseye_y
1253713
def get_radians(self):
        
        if not self: raise NullVectorError()
        return math.atan2(self.y, self.x)
231344
def calcPosition(self,parent_circle):
        '''  '''
        if r not in self:
            raise AttributeError("radius must be calculated before position.")
        if theta not in self:
            raise AttributeError("theta must be set before position can be calculated.")
        x_offset = math.cos(t_radians) * (parent_circle.r + self.r)
        y_offset = math.sin(t_radians) * (parent_circle.r + self.r)
        self.x = parent_circle.x + x_offset
        self.y = parent_circle.y + y_offset
775347
def get_coord_box(centre_x, centre_y, distance):
    """Todo: return coordinates inside a circle, rather than a square"""
    return {
        'top_left': (centre_x - distance, centre_y + distance),
        'top_right': (centre_x + distance, centre_y + distance),
        'bottom_left': (centre_x - distance, centre_y - distance),
        'bottom_right': (centre_x + distance, centre_y - distance),
    }
1135614
def index_to_coords(index, shape):
    ''''''
    coords = []
    for i in xrange(1, len(shape)):
        divisor = int(np.product(shape[i:]))
        value = index // divisor
        coords.append(value)
        index -= value * divisor
    coords.append(index)
    return tuple(coords)
179139
function parseTMXShapes() {
         var i = 0;
         var shapes = []; // add an ellipse shape

         if (this.isEllipse === true) {
           // ellipse coordinates are the center position, so set default to the corresonding radius
           shapes.push(new me.Ellipse(this.width / 2, this.height / 2, this.width, this.height).rotate(this.rotation));
         } // add a polygon
         else if (this.isPolygon === true) {
             shapes.push(new me.Polygon(0, 0, this.points).rotate(this.rotation));
           } // add a polyline
           else if (this.isPolyLine === true) {
               var p = this.points;
               var p1, p2;
               var segments = p.length - 1;

               for (i = 0; i < segments; i++) {
                 // clone the value before, as [i + 1]
                 // is reused later by the next segment
                 p1 = new me.Vector2d(p[i].x, p[i].y);
                 p2 = new me.Vector2d(p[i + 1].x, p[i + 1].y);

                 if (this.rotation !== 0) {
                   p1 = p1.rotate(this.rotation);
                   p2 = p2.rotate(this.rotation);
                 }

                 shapes.push(new me.Line(0, 0, [p1, p2]));
               }
             } // it's a rectangle, returns a polygon object anyway
             else {
                 shapes.push(new me.Polygon(0, 0, [new me.Vector2d(), new me.Vector2d(this.width, 0), new me.Vector2d(this.width, this.height), new me.Vector2d(0, this.height)]).rotate(this.rotation));
               } // Apply isometric projection


         if (this.orientation === "isometric") {
           for (i = 0; i < shapes.length; i++) {
             shapes[i].toIso();
           }
         }

         return shapes;
       }
1127378
def get_shape(bin_edges, sid):
    
    mag_bins, dist_bins, lon_bins, lat_bins, eps_bins = bin_edges
    return (len(mag_bins) - 1, len(dist_bins) - 1,
            len(lon_bins[sid]) - 1, len(lat_bins[sid]) - 1, len(eps_bins) - 1)
399730
def _parse_coords(self,opts):
        
        # The coordinates are mutually exclusive, so
        # shouldn't have to worry about over-writing them.
        if 'coords' in vars(opts): return
        radius = vars(opts).get('radius',0)
        gal = None
        if vars(opts).get('gal') is not None: 
            gal = opts.gal
        elif vars(opts).get('cel') is not None: 
            gal = cel2gal(*opts.cel)
        elif vars(opts).get('hpx') is not None: 
            gal = pix2ang(*opts.hpx)

        if gal is not None:
            opts.coords = [(gal[0],gal[1],radius)]
            opts.names = [vars(opts).get('name','')]
        else:
            opts.coords = None
            opts.names = None

        if vars(opts).get('targets') is not None:
            opts.names,opts.coords = self.parse_targets(opts.targets)
            if vars(opts).get('radius') is not None:
                opts.coords['radius'] = vars(opts).get('radius')
1314019
def ellipse(self, x, y, width, height, color):
        
        self.context.set_source_rgb(*color)
        self.context.save()
        self.context.translate(self.tx(x + (width / 2.0)), self.ty(y + (height / 2.0)))
        self.context.scale(self.tx(width / 2.0), self.ty(height / 2.0))
        self.context.arc(0.0, 0.0, 1.0, 0.0, 2 * math.pi)
        self.context.fill()
        self.context.restore()
106372
def getCoords(self):
        '''
        
        '''

        if DEBUG_COORDS:
            print >>sys.stderr, "getCoords(%s %s ## %s)" % (self.getClass(), self.getId(), self.getUniqueId())

        (x, y) = self.getXY();
        w = self.getWidth()
        h = self.getHeight()
        return ((x, y), (x+w, y+h))
296393
def getTopLeft(self):
        
        return (float(self.get_x()), float(self.get_y())+ float(self.get_height()))
361462
def axis_bounds(self) -> Dict[str, Tuple[float, float]]:
        
        return {ax: (0, pos+0.5) for ax, pos in _HOME_POSITION.items()
                if ax not in 'BC'}
1150021
def path_get(p: tcod.path.AStar, idx: int) -> Tuple[int, int]:
    
    x = ffi.new("int *")
    y = ffi.new("int *")
    lib.TCOD_path_get(p._path_c, idx, x, y)
    return x[0], y[0]
936335
def _get_y(self, kwargs):
        '''
        
        '''
        if 'y' in kwargs:
            return round(float(kwargs['y']), 6)
        elif self._element_y in kwargs:
            return round(float(kwargs[self._element_y]), 6)
        elif self._type == 3 and self._element_1my in kwargs:
            return round(1. - float(kwargs[self._element_1my]), 6)
        else:
            raise TypeError()
106975
def rightAt(self, offset=0):
        
        return Location(self.getX() + self.getW() + offset, self.getY() + (self.getH() / 2))