(self, o)
return Ellipse.intersection(self, o)
The intersection of this circle with another geometrical entity.

        Parameters
        ==========

        o : GeometryEntity

        Returns
        =======

        intersection : list of GeometryEntities

        Examples
        ========

        >>> from sympy import Point, Circle, Line, Ray
        >>> p1, p2, p3 = Point(0, 0), Point(5, 5), Point(6, 0)
        >>> p4 = Point(5, 0)
        >>> c1 = Circle(p1, 5)
        >>> c1.intersection(p2)
        []
        >>> c1.intersection(p4)
        [Point(5, 0)]
        >>> c1.intersection(Ray(p1, p2))
        [Point(5*sqrt(2)/2, 5*sqrt(2)/2)]
        >>> c1.intersection(Line(p2, p3))
        []
The intersection of this circle with another geometrical entity.
The intersection of this circle with another geometrical entity .
def intersection(self, o):
        """The intersection of this circle with another geometrical entity.

        Parameters
        ==========

        o : GeometryEntity

        Returns
        =======

        intersection : list of GeometryEntities

        Examples
        ========

        >>> from sympy import Point, Circle, Line, Ray
        >>> p1, p2, p3 = Point(0, 0), Point(5, 5), Point(6, 0)
        >>> p4 = Point(5, 0)
        >>> c1 = Circle(p1, 5)
        >>> c1.intersection(p2)
        []
        >>> c1.intersection(p4)
        [Point(5, 0)]
        >>> c1.intersection(Ray(p1, p2))
        [Point(5*sqrt(2)/2, 5*sqrt(2)/2)]
        >>> c1.intersection(Line(p2, p3))
        []

        """
        if isinstance(o, Circle):
            if o.center == self.center:
                if o.radius == self.radius:
                    return o
                return []
            dx, dy = (o.center - self.center).args
            d = sqrt(simplify(dy**2 + dx**2))
            R = o.radius + self.radius
            if d > R or d < abs(self.radius - o.radius):
                return []

            a = simplify((self.radius**2 - o.radius**2 + d**2) / (2*d))

            x2 = self.center.x + (dx * a/d)
            y2 = self.center.y + (dy * a/d)

            h = sqrt(simplify(self.radius**2 - a**2))
            rx = -dy * (h/d)
            ry = dx * (h/d)

            xi_1 = simplify(x2 + rx)
            xi_2 = simplify(x2 - rx)
            yi_1 = simplify(y2 + ry)
            yi_2 = simplify(y2 - ry)

            ret = [Point(xi_1, yi_1)]
            if xi_1 != xi_2 or yi_1 != yi_2:
                ret.append(Point(xi_2, yi_2))
            return ret

        return Ellipse.intersection(self, o)
def intersection ( self , o ) : if isinstance ( o , Circle ) : if o . center == self . center : if o . radius == self . radius : return o return [ ] dx , dy = ( o . center - self . center ) . args d = sqrt ( simplify ( dy ** 2 + dx ** 2 ) ) R = o . radius + self . radius if d > R or d < abs ( self . radius - o . radius ) : return [ ] a = simplify ( ( self . radius ** 2 - o . radius ** 2 + d ** 2 ) / ( 2 * d ) ) x2 = self . center . x + ( dx * a / d ) y2 = self . center . y + ( dy * a / d ) h = sqrt ( simplify ( self . radius ** 2 - a ** 2 ) ) rx = - dy * ( h / d ) ry = dx * ( h / d ) xi_1 = simplify ( x2 + rx ) xi_2 = simplify ( x2 - rx ) yi_1 = simplify ( y2 + ry ) yi_2 = simplify ( y2 - ry ) ret = [ Point ( xi_1 , yi_1 ) ] if xi_1 != xi_2 or yi_1 != yi_2 : ret . append ( Point ( xi_2 , yi_2 ) ) return ret return Ellipse . intersection ( self , o )