
    \h                        S r SSKJr  SSKJr  SSKJrJrJr  SSK	J
r
  SSKJr  SSKJr  SSKJrJr  SS	KJr  SS
KJrJrJr  SSKJr  SSKJr  SSKJrJr  SSKJ r J!r!  SSK"J#r#  SSK$J%r%J&r&  SSK'J(r(  SSK)J*r*J+r+J,r,J-r-J.r.J/r/  SSK0J1r1J2r2J3r3  SSK4J5r5J6r6  SSK7J8r8J9r9J:r:  SSK;J<r<J=r=  SSK>J?r?  SSK@JArA  SSKBJCrCJDrD  SSKEJFrF  SSKGrG\H" S5       V s/ s H
  n \" SSS 9PM     sn u  rIrJ " S! S"\&5      rK " S# S$\K5      rLSS%KMJNrNJOrO  gs  sn f )&z?Elliptical geometrical entities.

Contains
* Ellipse
* Circle

    )Expr)Eq)Spisympify)N)global_parameters)
fuzzy_bool)Rationaloo)ordered)Dummyuniquely_named_symbol_symbol)simplify)trigsimp)sqrtMax)cossin)
elliptic_e   )GeometryEntityGeometrySet)GeometryError)LineSegmentRay2D	Segment2DLine2DLinearEntity3D)PointPoint2DPoint3D)idifffind)DomainErrorPolyPolynomialError)_not_a_coeff_nsort)solve)linear_coeffs)
filldedent	func_name)prec_to_dpsN   ellipse_dummyTrealc                     ^  \ rS rSrSrS rS rU 4S jr S*S jrS+S jr	\
S 5       r\
S	 5       rS,S
 jr\
S 5       r\
S 5       r\
S 5       r\
S 5       r\
S 5       rS rS-S jrS.S jr\
S 5       r\
S 5       r\
S 5       rS rS r\
S 5       r\
S 5       rS/S jr\
S 5       r\
S 5       rS r S r!S,S jr"S/S  jr#S! r$S0U 4S" jjr%S1S# jr&S$ r'\
S% 5       r(S/S& jr)S' r*S/S( jr+S)r,U =r-$ )2Ellipse)   aZ  An elliptical GeometryEntity.

Parameters
==========

center : Point, optional
    Default value is Point(0, 0)
hradius : number or SymPy expression, optional
vradius : number or SymPy expression, optional
eccentricity : number or SymPy expression, optional
    Two of `hradius`, `vradius` and `eccentricity` must be supplied to
    create an Ellipse. The third is derived from the two supplied.

Attributes
==========

center
hradius
vradius
area
circumference
eccentricity
periapsis
apoapsis
focus_distance
foci

Raises
======

GeometryError
    When `hradius`, `vradius` and `eccentricity` are incorrectly supplied
    as parameters.
TypeError
    When `center` is not a Point.

See Also
========

Circle

Notes
-----
Constructed from a center and two radii, the first being the horizontal
radius (along the x-axis) and the second being the vertical radius (along
the y-axis).

When symbolic value for hradius and vradius are used, any calculation that
refers to the foci or the major or minor axis will assume that the ellipse
has its major radius on the x-axis. If this is not true then a manual
rotation is necessary.

Examples
========

>>> from sympy import Ellipse, Point, Rational
>>> e1 = Ellipse(Point(0, 0), 5, 1)
>>> e1.hradius, e1.vradius
(5, 1)
>>> e2 = Ellipse(Point(3, 1), hradius=3, eccentricity=Rational(4, 5))
>>> e2
Ellipse(Point2D(3, 1), 3, 9/5)

c                 :   [        U[        5      (       am  U R                  [        [        5      R                  [        UR                  [        UR                  05      n[        [        U5      5      [        R                  L $ [        U[        5      (       a  X:H  $ g)NF)
isinstancer"   equationxysubsr   r   r   Zeror6   )selforess      N/var/www/auris/envauris/lib/python3.13/site-packages/sympy/geometry/ellipse.py__contains__Ellipse.__contains__k   sk    a--1%**AqssAqss+;<CHSM*aff447##9    c                     [        U[        5      =(       aY    U R                  UR                  :H  =(       a9    U R                  UR                  :H  =(       a    U R                  UR                  :H  $ )z5Is the other GeometryEntity the same as this ellipse?)r9   r6   centerhradiusvradiusr?   r@   s     rB   __eq__Ellipse.__eq__s   sS    !W% F4;;!((+B ,E+/<<199+D,E+/<<199+D	FrE   c                     > [         TU ]  5       $ N)super__hash__)r?   	__class__s    rB   rP   Ellipse.__hash__y   s    w!!rE   c           
         [        U5      n[        U5      nUc  [        SS5      nO3[        U5      S:w  a  [        SR	                  U 5      5      e[        USS9n[        [        [        S X#U45      5      5      S:w  a  [        [        S5      5      eUbV  [        U5      nUR                  (       a  [        S5      eUc  U[        SUS-  -
  5      -  nOUc  U[        SUS-  -
  5      -  nX#:X  a  [        X40 UD6$ [        R                  X#4;   a8  [        [        US   U-
  US   U-
  5      [        US   U-   US   U-   5      5      $ UR                  S	L d  UR                  S	L a  [        S
5      e[         R"                  " XX#40 UD6$ )Nr   r1   z2The center of "{}" must be a two dimensional pointdimc                 
    U S L$ rN    )r;   s    rB   <lambda>!Ellipse.__new__.<locals>.<lambda>   s    Qd]rE   zt
                Exactly two arguments of "hradius", "vradius", and
                "eccentricity" must not be None.z8Eccentricity of ellipse/circle should lie between [0, 1)r   Fz;Invalid value encountered when computing hradius / vradius.)r   r"   len
ValueErrorformatlistfilterr.   is_negativer   r   Circler   r>   r   is_realr   __new__)clsrG   rH   rI   eccentricitykwargss         rB   rb   Ellipse.__new__|   s    '"'">1a[F6{a !U!\!\]`!abb6q)FtF2W|4TUVW[\\Z )4 5 6 6 #"<0L''#$^__!D\1_)<$==!D\1_)<$==&4V4466g''5W!4fQi'6IJERXYZR[^eRegmnogpszgzL{||??e#w%'? ]^^%%c7NvNNrE   c                     [        U R                  5      n[        U R                  5      [        U R                  5      pTSR	                  SU-  X#R
                  UR                  XE5      $ )zReturns SVG ellipse element for the Ellipse.

Parameters
==========

scale_factor : float
    Multiplication factor for the SVG stroke-width.  Default is 1.
fill_color : str, optional
    Hex string for fill color. Default is "#66cc99".
zk<ellipse fill="{1}" stroke="#555555" stroke-width="{0}" opacity="0.6" cx="{2}" cy="{3}" rx="{4}" ry="{5}"/>g       @)r   rG   rH   rI   r\   r;   r<   )r?   scale_factor
fill_colorchvs         rB   _svgEllipse._svg   sQ     dkkN$,,1U
&l"JQSS!
?	@rE   c                     g)Nr1   rW   r?   s    rB   ambient_dimensionEllipse.ambient_dimension   s    rE   c                 :    U R                   SU R                  -   -  $ )aV  The apoapsis of the ellipse.

The greatest distance between the focus and the contour.

Returns
=======

apoapsis : number

See Also
========

periapsis : Returns shortest distance between foci and contour

Examples
========

>>> from sympy import Point, Ellipse
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, 1)
>>> e1.apoapsis
2*sqrt(2) + 3

r   majorrd   rp   s    rB   apoapsisEllipse.apoapsis       4 zzQ!2!2233rE   c                 f   [        USS9nUR                  S U R                   5       ;   a!  [        [	        SUR                  -  5      5      e[        U R                  R                  U R                  [        U5      -  -   U R                  R                  U R                  [        U5      -  -   5      $ )a  A parameterized point on the ellipse.

Parameters
==========

parameter : str, optional
    Default value is 't'.

Returns
=======

arbitrary_point : Point

Raises
======

ValueError
    When `parameter` already appears in the functions.

See Also
========

sympy.geometry.point.Point

Examples
========

>>> from sympy import Point, Ellipse
>>> e1 = Ellipse(Point(0, 0), 3, 2)
>>> e1.arbitrary_point()
Point2D(3*cos(t), 2*sin(t))

Tr3   c              3   8   #    U  H  oR                   v   M     g 7frN   )name).0fs     rB   	<genexpr>*Ellipse.arbitrary_point.<locals>.<genexpr>   s     8&7ff&7s   zFSymbol %s already appears in object and cannot be used as a parameter.)r   r{   free_symbolsr[   r.   r"   rG   r;   rH   r   r<   rI   r   r?   	parameterts      rB   arbitrary_pointEllipse.arbitrary_point   s    D ID)668d&7&788Z )MOPvv)V W X XT[[]]T\\#a&%88[[]]T\\#a&%88: 	:rE   c                 h    [        [        R                  U R                  -  U R                  -  5      $ )zThe area of the ellipse.

Returns
=======

area : number

Examples
========

>>> from sympy import Point, Ellipse
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, 1)
>>> e1.area
3*pi

)r   r   PirH   rI   rp   s    rB   areaEllipse.area   s%    & t||+dll:;;rE   c                     U R                   U R                  p!U R                  R                  U-
  U R                  R                  U-
  U R                  R                  U-   U R                  R                  U-   4$ )zgReturn a tuple (xmin, ymin, xmax, ymax) representing the bounding
rectangle for the geometric figure.

)rH   rI   rG   r;   r<   )r?   rk   rl   s      rB   boundsEllipse.bounds  sW     ||T\\1!4;;==1#4dkkmma6GYZIZ[[rE   c                      U R                   S   $ )zThe center of the ellipse.

Returns
=======

center : number

See Also
========

sympy.geometry.point.Point

Examples
========

>>> from sympy import Point, Ellipse
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, 1)
>>> e1.center
Point2D(0, 0)

r   argsrp   s    rB   rG   Ellipse.center      0 yy|rE   c                     U R                   S:X  a  SU R                  -  $ U R                   S:X  a  S[        -  U R                  -  $ SU R                  -  [	        U R                   S-  5      -  $ )zThe circumference of the ellipse.

Examples
========

>>> from sympy import Point, Ellipse
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, 1)
>>> e1.circumference
12*elliptic_e(8/9)

r      r   r1   )rd   ru   r   rH   r   rp   s    rB   circumferenceEllipse.circumference7  sd     !TZZ<!#R4$$TZZ<
4+<+<a+? @@@rE   c                 4    U R                   U R                  -  $ )zThe eccentricity of the ellipse.

Returns
=======

eccentricity : number

Examples
========

>>> from sympy import Point, Ellipse, sqrt
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, sqrt(2))
>>> e1.eccentricity
sqrt(7)/3

)focus_distanceru   rp   s    rB   rd   Ellipse.eccentricityN  s    & ""TZZ//rE   c                 \   [        USS9nX;   a  g[        U R                  5      S:X  aB  U R                   Vs/ s H  o"R                  U5      PM     snu  p4SU R                  -  X4-   -
  nO(U R
                  U R                  R                  U5      -
  n[        UR                  5      $ s  snf )a  
Return True if p is enclosed by (is inside of) self.

Notes
-----
Being on the border of self is considered False.

Parameters
==========

p : Point

Returns
=======

encloses_point : True, False or None

See Also
========

sympy.geometry.point.Point

Examples
========

>>> from sympy import Ellipse, S
>>> from sympy.abc import t
>>> e = Ellipse((0, 0), 3, 2)
>>> e.encloses_point((0, 0))
True
>>> e.encloses_point(e.arbitrary_point(t).subs(t, S.Half))
False
>>> e.encloses_point((4, 0))
False

r1   rT   F)	r"   rZ   focidistanceru   radiusrG   r
   is_positive)r?   pr}   h1h2tests         rB   encloses_pointEllipse.encloses_pointc  s    J !O9tyy>Q
 .2YY7YjjmY7FBTZZ<27+D;;!5!5a!88D$**++ 8s   B)c                 v   [        USS9n[        USS9nXR                  R                  -
  nX R                  R                  -
  nUbJ  XSU-  -
  S-  nX5-  U-   S-  nSUS-  -   nXR                  S-  -  n	XR
                  S-  -  n
Xy-  Xj-  -   S-
  $ X@R                  -  S-  nXPR                  -  S-  nX-   S-
  $ )an  
Returns the equation of an ellipse aligned with the x and y axes;
when slope is given, the equation returned corresponds to an ellipse
with a major axis having that slope.

Parameters
==========

x : str, optional
    Label for the x-axis. Default value is 'x'.
y : str, optional
    Label for the y-axis. Default value is 'y'.
_slope : Expr, optional
        The slope of the major axis. Ignored when 'None'.

Returns
=======

equation : SymPy expression

See Also
========

arbitrary_point : Returns parameterized point on ellipse

Examples
========

>>> from sympy import Point, Ellipse, pi
>>> from sympy.abc import x, y
>>> e1 = Ellipse(Point(1, 0), 3, 2)
>>> eq1 = e1.equation(x, y); eq1
y**2/4 + (x/3 - 1/3)**2 - 1
>>> eq2 = e1.equation(x, y, _slope=1); eq2
(-x + y + 1)**2/8 + (x + y - 1)**2/18 - 1

A point on e1 satisfies eq1. Let's use one on the x-axis:

>>> p1 = e1.center + Point(e1.major, 0)
>>> assert eq1.subs(x, p1.x).subs(y, p1.y) == 0

When rotated the same as the rotated ellipse, about the center
point of the ellipse, it will satisfy the rotated ellipse's
equation, too:

>>> r1 = p1.rotate(pi/4, e1.center)
>>> assert eq2.subs(x, r1.x).subs(y, r1.y) == 0

References
==========

.. [1] https://math.stackexchange.com/questions/108270/what-is-the-equation-of-an-ellipse-that-is-not-aligned-with-the-axis
.. [2] https://en.wikipedia.org/wiki/Ellipse#Shifted_ellipse

Tr3   r1   r   )r   rG   r;   r<   ru   minorrH   rI   )r?   r;   r<   _slopedxdyLlrk   bat1t2s                rB   r:   Ellipse.equation  s    r AD!AD!Ri!#AR!#AFAIA**a-A**a-A39q=  \\/A%B\\/A%B7Q;rE   c                    [        U R                  5      S:w  a  [        S5      e[        USS9n[        USS9nU R                  XR
                  R                  -
  -  [        SS5      -  nU R                  X R
                  R                  -
  -  [        SS5      -  nX4-   U R                  S-  U R                  S-  -
  [        SS5      -  -
  $ )a  The equation of evolute of the ellipse.

Parameters
==========

x : str, optional
    Label for the x-axis. Default value is 'x'.
y : str, optional
    Label for the y-axis. Default value is 'y'.

Returns
=======

equation : SymPy expression

Examples
========

>>> from sympy import Point, Ellipse
>>> e1 = Ellipse(Point(1, 0), 3, 2)
>>> e1.evolute()
2**(2/3)*y**(2/3) + (3*x - 3)**(2/3) - 5**(2/3)
   z.Evolute of arbitrary Ellipse is not supported.Tr3   r1   )
rZ   r   NotImplementedErrorr   rH   rG   r;   r   rI   r<   r?   r;   r<   r   r   s        rB   evoluteEllipse.evolute  s    0 tyy>Q%&VWWAD!AD!llA-.!Q?llA-.!Q?w$,,/DLL!O;hq!nLLLrE   c                 b   U R                   nU R                  U R                  p2X#:X  a  X4$ [        U R                  S-  U R
                  S-  -
  5      nX R
                  :X  a  U[        SU* 5      -   U[        SU5      -   4$ X R                  :X  a  U[        U* S5      -   U[        US5      -   4$ g)a  The foci of the ellipse.

Notes
-----
The foci can only be calculated if the major/minor axes are known.

Raises
======

ValueError
    When the major and minor axis cannot be determined.

See Also
========

sympy.geometry.point.Point
focus_distance : Returns the distance between focus and center

Examples
========

>>> from sympy import Point, Ellipse
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, 1)
>>> e1.foci
(Point2D(-2*sqrt(2), 0), Point2D(2*sqrt(2), 0))

r1   r   N)rG   rH   rI   r   ru   r   r"   )r?   rj   hrvrfds        rB   r   Ellipse.foci  s    < KKt||B86M $**a-$**a-/0a"%q5B<'788::rc1%q5Q<'788 rE   c                 ^    [         R                  " U R                  U R                  S   5      $ )a   The focal distance of the ellipse.

The distance between the center and one focus.

Returns
=======

focus_distance : number

See Also
========

foci

Examples
========

>>> from sympy import Point, Ellipse
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, 1)
>>> e1.focus_distance
2*sqrt(2)

r   )r"   r   rG   r   rp   s    rB   r   Ellipse.focus_distance1  s!    4 ~~dkk499Q<88rE   c                      U R                   S   $ )zThe horizontal radius of the ellipse.

Returns
=======

hradius : number

See Also
========

vradius, major, minor

Examples
========

>>> from sympy import Point, Ellipse
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, 1)
>>> e1.hradius
3

r   r   rp   s    rB   rH   Ellipse.hradiusM  r   rE   c                    [        U[        5      (       a
  X;   a  U/$ / $ [        U[        [        45      (       a  U R	                  [
        [        5      n[        U[        UR                  S   UR                  S   5      R	                  [
        [        5      /[
        [        /SS9S   n[        [        U Vs/ s H  oDU;   d  M
  [        U5      PM     sn5      5      $ [        U[        5      (       a  UR                  U 5      $ [        U[        [        45      (       a~  X:X  a  U $ U R	                  [
        [        5      n[        [        [        X!R	                  [
        [        5      /[
        [        /SS9S    Vs/ s H  n[        U5      PM     sn5      5      $ [        U[         5      (       a  [#        S5      e[#        S[%        U5      -  5      es  snf s  snf )a  The intersection of this ellipse and another geometrical entity
`o`.

Parameters
==========

o : GeometryEntity

Returns
=======

intersection : list of GeometryEntity objects

Notes
-----
Currently supports intersections with Point, Line, Segment, Ray,
Circle and Ellipse types.

See Also
========

sympy.geometry.entity.GeometryEntity

Examples
========

>>> from sympy import Ellipse, Point, Line
>>> e = Ellipse(Point(0, 0), 5, 7)
>>> e.intersection(Point(0, 0))
[]
>>> e.intersection(Point(5, 0))
[Point2D(5, 0)]
>>> e.intersection(Line(Point(0,0), Point(0, 1)))
[Point2D(0, -7), Point2D(0, 7)]
>>> e.intersection(Line(Point(5,0), Point(5, 1)))
[Point2D(5, 0)]
>>> e.intersection(Line(Point(6,0), Point(6, 1)))
[]
>>> e = Ellipse(Point(-1, 0), 4, 3)
>>> e.intersection(Ellipse(Point(1, 0), 4, 3))
[Point2D(0, -3*sqrt(15)/4), Point2D(0, 3*sqrt(15)/4)]
>>> e.intersection(Ellipse(Point(5, 0), 4, 3))
[Point2D(2, -3*sqrt(7)/4), Point2D(2, 3*sqrt(7)/4)]
>>> e.intersection(Ellipse(Point(100500, 0), 4, 3))
[]
>>> e.intersection(Ellipse(Point(0, 0), 3, 4))
[Point2D(3, 0), Point2D(-363/175, -48*sqrt(111)/175), Point2D(-363/175, 48*sqrt(111)/175)]
>>> e.intersection(Ellipse(Point(-1, 0), 3, 4))
[Point2D(-17/5, -12/5), Point2D(-17/5, 12/5), Point2D(7/5, -12/5), Point2D(7/5, 12/5)]
r   r   T)set5Entity must be two dimensional, not three dimensionalzIntersection not handled for %s)r9   r"   r   r   r:   r;   r<   r,   r   pointsr]   r   Polygonintersectionr6   r    r!   	TypeErrorr/   )r?   r@   ellipse_equationresultis        rB   r   Ellipse.intersectiong  s   j ays
	Iu-..#}}Q2,dQXXa[/**2(1a.:<=q6F 6 D6a!Vq6 DEFF7##>>$''GV,--y#'==A#6 Gu%zz!Q'781a&88! %" 8!!U1X 8! %" # $ $ >**STT=	!LMM! !E%"s   9	GG?Gc                   ^ ^ [        T[        5      (       a  g[        T[        5      (       aE  T R                  T5      n[        U[        5      (       a  gU(       a  [	        UU 4S jU 5       5      $ g[        T[
        5      (       a@  T R                  T5      nU(       d  g[        U5      S:X  a  gUS   R                  US   5      $ [        T[        [        45      (       a;  T R                  T5      n[        U5      S:X  a  TT R                  US   5      S   ;   $ g[        T[        5      (       a  [	        U 4S jTR                   5       5      $ [        T[        [        45      (       a  [        S5      e[        S[!        T5      -  5      e)	a  Is `o` tangent to the ellipse?

Parameters
==========

o : GeometryEntity
    An Ellipse, LinearEntity or Polygon

Raises
======

NotImplementedError
    When the wrong type of argument is supplied.

Returns
=======

is_tangent: boolean
    True if o is tangent to the ellipse, False otherwise.

See Also
========

tangent_lines

Examples
========

>>> from sympy import Point, Ellipse, Line
>>> p0, p1, p2 = Point(0, 0), Point(3, 0), Point(3, 3)
>>> e1 = Ellipse(p0, 3, 2)
>>> l1 = Line(p1, p2)
>>> e1.is_tangent(l1)
True

FTc              3      >#    U  H:  nTR                  U5      S    R                  TR                  U5      S    5      v   M<     g7fr   N)tangent_linesequals)r|   r   r@   r?   s     rB   r~   %Ellipse.is_tangent.<locals>.<genexpr>  sA     g]fXYD..q1!4<<Q__Q=OPQ=RSS]fs   AAr   r   c              3   F   >#    U  H  nTR                  U5      v   M     g 7frN   )
is_tangent)r|   sr?   s     rB   r~   r     s     ;7atq))7s   !r   zIs_tangent not handled for %s)r9   r#   r6   r   allr    rZ   r   r   r   r   r   sidesr!   r$   r   r/   )r?   r@   	intersecthits   ``  rB   r   Ellipse.is_tangent  sH   J a!!7##))!,I)W--g]fggg6""##A&C3x1}q6==Q((Iu-..))!,I9~"D..y|<Q???7##;177;;;NG455STT;ilJKKrE   c                     U R                   SS n[        U5      S:X  a  US   $ Uu  p#X2-
  S:  nUS:X  a  U$ US:X  a  U$ U R                  $ )a  Longer axis of the ellipse (if it can be determined) else hradius.

Returns
=======

major : number or expression

See Also
========

hradius, vradius, minor

Examples
========

>>> from sympy import Point, Ellipse, Symbol
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, 1)
>>> e1.major
3

>>> a = Symbol('a')
>>> b = Symbol('b')
>>> Ellipse(p1, a, b).major
a
>>> Ellipse(p1, b, a).major
b

>>> m = Symbol('m')
>>> M = m + 1
>>> Ellipse(p1, m, M).major
m + 1

r   r   r   TF)r   rZ   rH   r?   abr   r   r@   s        rB   ru   Ellipse.major  \    H YYq^r7a<a5LEAI9H%ZH||rE   c                     U R                   SS n[        U5      S:X  a  US   $ Uu  p#X#-
  S:  nUS:X  a  U$ US:X  a  U$ U R                  $ )a  Shorter axis of the ellipse (if it can be determined) else vradius.

Returns
=======

minor : number or expression

See Also
========

hradius, vradius, major

Examples
========

>>> from sympy import Point, Ellipse, Symbol
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, 1)
>>> e1.minor
1

>>> a = Symbol('a')
>>> b = Symbol('b')
>>> Ellipse(p1, a, b).minor
b
>>> Ellipse(p1, b, a).minor
a

>>> m = Symbol('m')
>>> M = m + 1
>>> Ellipse(p1, m, M).minor
m

r   r   r   TF)r   rZ   rI   r   s        rB   r   Ellipse.minor,  r   rE   c                    [        USS9n / nUR                  U R                  R                  :X  a'  UR                  [	        U R                  [
        S95        UR                  U R                  R                  :X  a#  UR                  [	        U R                  SS95        U(       a  U$ U R                  [        [        5      n[        U[        [        5      nSU-  n[	        U[        [        45      R                  nXv-
  n[        U[        5      S   n	UR                  [        U	5      R                  5       S   R                  5       n
[        U
R                  5      S:X  aa   [!        U
[        5      R#                  5       nU Vs/ s H4  n[        U[        UR                  [        U5      [        5      S   5      PM6     nnO[)        S	5      eU Vs/ s H1  oR                  [-        [        [        4UR.                  5      5      PM3     nnUbS  U Vs/ s H  oR1                  U5      PM     nnU Vs/ s H&  n[3        U5      (       a  UOUR1                  U5      PM(     nn[-        X5       VVs/ s H  u  nn[	        UUS9PM     snn$ ! [$        [&        [(        4 a    [+        [        U
[        5      SS9S   n GN=f = fs  snf s  snf s  snf s  snf s  snnf )
ay  Normal lines between `p` and the ellipse.

Parameters
==========

p : Point

Returns
=======

normal_lines : list with 1, 2 or 4 Lines

Examples
========

>>> from sympy import Point, Ellipse
>>> e = Ellipse((0, 0), 2, 3)
>>> c = e.center
>>> e.normal_lines(c + Point(1, 0))
[Line2D(Point2D(0, 0), Point2D(1, 0))]
>>> e.normal_lines(c)
[Line2D(Point2D(0, 0), Point2D(0, 1)), Line2D(Point2D(0, 0), Point2D(1, 0))]

Off-axis points require the solution of a quartic equation. This
often leads to very large expressions that may be of little practical
use. An approximate solution of `prec` digits can be obtained by
passing in the desired value:

>>> e.normal_lines((3, 3), prec=2)
[Line2D(Point2D(-0.81, -2.7), Point2D(0.19, -1.2)),
Line2D(Point2D(1.5, -2.0), Point2D(2.5, -2.7))]

Whereas the above solution has an operation count of 12, the exact
solution has an operation count of 2020.
r1   rT   T)sloper   r   )	separatedz7intersections for the general ellipse are not supported)r"   r;   rG   appendr   r   r<   r:   r%   r   r,   r=   as_numer_denomexpandrZ   r   r(   
real_rootsr'   r)   r   r+   zipr   nr*   )r?   r   precrveqdydxnormr   seqyisxeqxsolr   r   ptslopesr   s                    rB   normal_linesEllipse.normal_lines[  sL   H !O
 Bssdkkmm#		$t{{"56ssdkkmm#		$t{{!45 	 ]]1a RA$wQA%%l CmAggao,,.q188:s A%@C|..0 EIIDqeAuRWWQ]A6q9:DFIF%IK K<BCFb))CA01FC+126Rdd4j6F2CIJ6a<??aD	96FJ/26/BC/Beb!Rq!/BCC  2EF @eCmt<Q?@ J D2JCs0   #J ;K8KK3-K0K0J?>J?c                 :    U R                   SU R                  -
  -  $ )aY  The periapsis of the ellipse.

The shortest distance between the focus and the contour.

Returns
=======

periapsis : number

See Also
========

apoapsis : Returns greatest distance between focus and contour

Examples
========

>>> from sympy import Point, Ellipse
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, 1)
>>> e1.periapsis
3 - 2*sqrt(2)

r   rt   rp   s    rB   	periapsisEllipse.periapsis  rx   rE   c                 @    U R                   SU R                  S-  -
  -  $ )a  
Calculates the semi-latus rectum of the Ellipse.

Semi-latus rectum is defined as one half of the chord through a
focus parallel to the conic section directrix of a conic section.

Returns
=======

semilatus_rectum : number

See Also
========

apoapsis : Returns greatest distance between focus and contour

periapsis : The shortest distance between the focus and the contour

Examples
========

>>> from sympy import Point, Ellipse
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, 1)
>>> e1.semilatus_rectum
1/3

References
==========

.. [1] https://mathworld.wolfram.com/SemilatusRectum.html
.. [2] https://en.wikipedia.org/wiki/Ellipse#Semi-latus_rectum

r   r1   rt   rp   s    rB   semilatus_rectumEllipse.semilatus_rectum  s$    H zzQ!2!2a!7788rE   c                 j    [        U R                  [        U R                  U R                  5      5      $ )a<  Returns a Circle whose diameter is the major axis of the ellipse.

Examples
========

>>> from sympy import Ellipse, Point, symbols
>>> c = Point(1, 2)
>>> Ellipse(c, 8, 7).auxiliary_circle()
Circle(Point2D(1, 2), 8)
>>> a, b = symbols('a b')
>>> Ellipse(c, a, b).auxiliary_circle()
Circle(Point2D(1, 2), Max(a, b))
)r`   rG   r   rH   rI   rp   s    rB   auxiliary_circleEllipse.auxiliary_circle  s$     dkk3t||T\\#BCCrE   c                 z    [        U R                  [        U R                  S-  U R                  S-  -   5      5      $ )a  
Returns a Circle consisting of all points where two perpendicular
tangent lines to the ellipse cross each other.

Returns
=======

Circle
    A director circle returned as a geometric object.

Examples
========

>>> from sympy import Ellipse, Point, symbols
>>> c = Point(3,8)
>>> Ellipse(c, 7, 9).director_circle()
Circle(Point2D(3, 8), sqrt(130))
>>> a, b = symbols('a b')
>>> Ellipse(c, a, b).director_circle()
Circle(Point2D(3, 8), sqrt(a**2 + b**2))

References
==========

.. [1] https://en.wikipedia.org/wiki/Director_circle

r1   )r`   rG   r   rH   rI   rp   s    rB   director_circleEllipse.director_circle  s/    8 dkk4a$,,/(I#JKKrE   c                 Z    [        USS9nU[        R                  * [        R                  /$ )a`  The plot interval for the default geometric plot of the Ellipse.

Parameters
==========

parameter : str, optional
    Default value is 't'.

Returns
=======

plot_interval : list
    [parameter, lower_bound, upper_bound]

Examples
========

>>> from sympy import Point, Ellipse
>>> e1 = Ellipse(Point(0, 0), 3, 2)
>>> e1.plot_interval()
[t, -pi, pi]

Tr3   )r   r   r   r   s      rB   plot_intervalEllipse.plot_interval  s'    0 ID)ADD5!$$rE   c                 p   [        SSS9nU R                  U5      R                  u  p4Ub  [        R                  " U5      nO[        n[        UR                  5       5      nSU-  S-
  n[        SUS-  -
  5      n[        UR                  [        U5      U5      UR                  [        U5      U5      5      $ )aP  A random point on the ellipse.

Returns
=======

point : Point

Examples
========

>>> from sympy import Point, Ellipse
>>> e1 = Ellipse(Point(0, 0), 3, 2)
>>> e1.random_point() # gives some random point
Point2D(...)
>>> p1 = e1.random_point(seed=0); p1.n(2)
Point2D(2.1, 1.4)

Notes
=====

When creating a random point, one may simply replace the
parameter with a random number. When doing so, however, the
random number should be made a Rational or else the point
may not test as being in the ellipse:

>>> from sympy.abc import t
>>> from sympy import Rational
>>> arb = e1.arbitrary_point(t); arb
Point2D(3*cos(t), 2*sin(t))
>>> arb.subs(t, .1) in e1
False
>>> arb.subs(t, Rational(.1)) in e1
True
>>> arb.subs(t, Rational('.1')) in e1
True

See Also
========
sympy.geometry.point.Point
arbitrary_point : Returns parameterized point on ellipse
r   Tr3   r1   r   )r   r   r   randomRandomr   r   r"   r=   r   r   )	r?   seedr   r;   r<   rngrrj   r   s	            rB   random_pointEllipse.random_point6  s    T Cd###A&++ --%CCSZZ\"aC!GQTNQVVCFA&s1vq(9::rE   c                    UR                   S[        4;   aD  U R                  nUR                  U5      nU R	                  X R
                  * U R                  5      $ S Vs/ s H  n[        X0U4S SS9PM     snu  pEU R                  XE5      n[        XE5      R                  U5      nUR                  [        XE4UR                  5      SS9n[        [        SS[        U5      < S	[        U5      < S
[        U5      < 3-   5      5      es  snf )a  Override GeometryEntity.reflect since the radius
is not a GeometryEntity.

Examples
========

>>> from sympy import Circle, Line
>>> Circle((0, 1), 1).reflect(Line((0, 0), (1, 1)))
Circle(Point2D(1, 0), -1)
>>> from sympy import Ellipse, Line, Point
>>> Ellipse(Point(3, 4), 1, 3).reflect(Line(Point(0, -4), Point(5, 0)))
Traceback (most recent call last):
...
NotImplementedError:
General Ellipse is not supported but the equation of the reflected
Ellipse is given by the zeros of: f(x, y) = (9*x/41 + 40*y/41 +
37/41)**2 + (40*x/123 - 3*y/41 - 364/123)**2 - 1

Notes
=====

Until the general ellipse (with no axis parallel to the x-axis) is
supported a NotImplemented error is raised and the equation whose
zeros define the rotated ellipse is given.

r   xyc                     SU -   $ )N_rW   )r   s    rB   rX   !Ellipse.reflect.<locals>.<lambda>  s    S1WrE   T)modifyr4   )simultaneouszeGeneral Ellipse is not supported but the equation of the reflected Ellipse is given by the zeros of: zf(z, z) = )r   r   rG   reflectfuncrH   rI   r   r:   r"   r=   r   r   r   r.   str)	r?   linerj   r{   r;   r<   exprr   r   s	            rB   r  Ellipse.reflectn  s   8 ::!R A		$A99Qt||<< !" D *Tl+<4I "DA ==&Da##D)AYYsA6166  %37  9F%jF$'FCFCK@A'B C C"s   D
c                   > U R                   U R                  :X  a5  U R                  U R                  R	                  X5      U R                   5      $ U[
        R                  -  R                  (       a  [        TU ]  X5      $ SU-  [
        R                  -  R                  (       a@  U R                  U R                  R	                  X5      U R                  U R                   5      $ [        S5      e)am  Rotate ``angle`` radians counterclockwise about Point ``pt``.

Note: since the general ellipse is not supported, only rotations that
are integer multiples of pi/2 are allowed.

Examples
========

>>> from sympy import Ellipse, pi
>>> Ellipse((1, 0), 2, 1).rotate(pi/2)
Ellipse(Point2D(0, 1), 1, 2)
>>> Ellipse((1, 0), 2, 1).rotate(pi)
Ellipse(Point2D(-1, 0), 2, 1)
r1   z;Only rotations of pi/2 are currently supported for Ellipse.)
rH   rI   r  rG   rotater   r   
is_integerrO   r   )r?   angler   rQ   s      rB   r  Ellipse.rotate  s     <<4<<'99T[[//:DLLII!$$J""7>%,,eGADDL$$99T[[//:DLL$,,WW!"_``rE   c                 4   U R                   nU(       aJ  [        USS9nU R                  " U* R                  6 R	                  X5      R                  " UR                  6 $ U R
                  nU R                  nU R                  UR	                  X5      XQ-  Xb-  S9$ )a,  Override GeometryEntity.scale since it is the major and minor
axes which must be scaled and they are not GeometryEntities.

Examples
========

>>> from sympy import Ellipse
>>> Ellipse((0, 0), 2, 1).scale(2, 4)
Circle(Point2D(0, 0), 4)
>>> Ellipse((0, 0), 2, 1).scale(2)
Ellipse(Point2D(0, 0), 4, 1)
r1   rT   rH   rI   )rG   r"   	translater   scalerH   rI   r  )r?   r;   r<   r   rj   rk   rl   s          rB   r"  Ellipse.scale  s~     KKrq!B>>RC::.44Q:DDbggNNLLLLyyQSyAArE   c           	         [        USS9nU R                  U5      (       a  / $ X;   a  U R                  U-
  nU R                  S-  UR                  -  nU R
                  S-  * UR                  -  n[        [        UR                  U-   5      [        UR                  U-   5      5      n[        X5      /$ [        U R                  5      S:X  aN  U R                  u  pgU R
                  nSU-  [         R                  " Xa5      -
  [         R                  " Xq5      -
  n	O.U R                  [         R                  " U R                  U5      -
  n	U	R                  (       a  U	R                  (       a  / $ U R                  [        [        5      n
[!        U
[        [        5      n[        U[        [        [        5      5      R"                  n[%        X-
  U
/[        [        /5      n[        U5      S:X  a  US   S   UR                  :X  d  US   S   UR                  :X  a0  [        X[        SS5      -   5      [        X[        SS5      -   5      /$ [        X[        SS5      -   5      [        XS   5      /$ [        XS   5      [        XS   5      /$ )a  Tangent lines between `p` and the ellipse.

If `p` is on the ellipse, returns the tangent line through point `p`.
Otherwise, returns the tangent line(s) from `p` to the ellipse, or
None if no tangent line is possible (e.g., `p` inside ellipse).

Parameters
==========

p : Point

Returns
=======

tangent_lines : list with 1 or 2 Lines

Raises
======

NotImplementedError
    Can only find tangent lines for a point, `p`, on the ellipse.

See Also
========

sympy.geometry.point.Point, sympy.geometry.line.Line

Examples
========

>>> from sympy import Point, Ellipse
>>> e1 = Ellipse(Point(0, 0), 3, 2)
>>> e1.tangent_lines(Point(3, 0))
[Line2D(Point2D(3, 0), Point2D(3, -12))]

r1   rT   r   r   )r"   r   rG   rI   r;   rH   r<   r   r   rZ   r   r   r   	is_numberr   r:   r%   r   r,   )r?   r   deltariserunp2f1f2majr   r   r   r   tangent_pointss                 rB   r   Ellipse.tangent_lines  s   J !Oq!!I9KK!OELL!OUWW,DLL!O$UWW,Cxc	*d
+-BK= 499~"ll#r-.r-. {{U^^DKK%CC~~$"2"2	 q!$BQ?DE!QK(..E #EL"#51v>N >"a'!!$!"%(6q(9!(<(C aO4d1%1+o6NOO aO4d1Q>O6PQQ 1-.Qq8I0JKKrE   c                      U R                   S   $ )zThe vertical radius of the ellipse.

Returns
=======

vradius : number

See Also
========

hradius, major, minor

Examples
========

>>> from sympy import Point, Ellipse
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, 1)
>>> e1.vradius
1

r1   r   rp   s    rB   rI   Ellipse.vradius  r   rE   c                 $   [         R                  U R                  -  U R                  S-  -  S-  n[         R                  U R                  S-  -  U R                  -  S-  nSnUc  X#U4$ X R                  US   U R
                  R                  -
  S-  -  -   nX0R                  US   U R
                  R                  -
  S-  -  -   nX@R                  US   U R
                  R                  -
  -  US   U R
                  R                  -
  -  -   nX#U4$ )a  Returns the second moment and product moment area of an ellipse.

Parameters
==========

point : Point, two-tuple of sympifiable objects, or None(default=None)
    point is the point about which second moment of area is to be found.
    If "point=None" it will be calculated about the axis passing through the
    centroid of the ellipse.

Returns
=======

I_xx, I_yy, I_xy : number or SymPy expression
    I_xx, I_yy are second moment of area of an ellise.
    I_xy is product moment of area of an ellipse.

Examples
========

>>> from sympy import Point, Ellipse
>>> p1 = Point(0, 0)
>>> e1 = Ellipse(p1, 3, 1)
>>> e1.second_moment_of_area()
(3*pi/4, 27*pi/4, 0)

References
==========

.. [1] https://en.wikipedia.org/wiki/List_of_second_moments_of_area

r   r   r   r   r1   )r   r   rH   rI   r   rG   r<   r;   )r?   pointI_xxI_yyI_xys        rB   second_moment_of_areaEllipse.second_moment_of_area3  s    D dll#T\\1_5q8dllAo&5q8=t## ii%(T[[]]":Q!>??ii%(T[[]]":Q!>??iiqDKKMM!9:E!Ht{{}}<TUU4rE   c                 8    U R                  5       nUS   US   -   $ )ae  Returns the polar second moment of area of an Ellipse

It is a constituent of the second moment of area, linked through
the perpendicular axis theorem. While the planar second moment of
area describes an object's resistance to deflection (bending) when
subjected to a force applied to a plane parallel to the central
axis, the polar second moment of area describes an object's
resistance to deflection when subjected to a moment applied in a
plane perpendicular to the object's central axis (i.e. parallel to
the cross-section)

Examples
========

>>> from sympy import symbols, Circle, Ellipse
>>> c = Circle((5, 5), 4)
>>> c.polar_second_moment_of_area()
128*pi
>>> a, b = symbols('a, b')
>>> e = Ellipse((0, 0), a, b)
>>> e.polar_second_moment_of_area()
pi*a**3*b/4 + pi*a*b**3/4

References
==========

.. [1] https://en.wikipedia.org/wiki/Polar_moment_of_inertia

r   r   )r6  )r?   second_moments     rB   polar_second_moment_of_area#Ellipse.polar_second_moment_of_aread  s'    < 224Q-"222rE   c                    U R                   u  p#Uc0  U R                  u  pEpg[        X5-
  Xs-
  5      n[        X$-
  Xb-
  5      n	O)[        U5      nUR                  U-
  nUR
                  U-
  n	U R                  5       n
U
S   U-  nU
S   U	-  nX4$ )a  Returns a tuple with the section modulus of an ellipse

Section modulus is a geometric property of an ellipse defined as the
ratio of second moment of area to the distance of the extreme end of
the ellipse from the centroidal axis.

Parameters
==========

point : Point, two-tuple of sympifyable objects, or None(default=None)
    point is the point at which section modulus is to be found.
    If "point=None" section modulus will be calculated for the
    point farthest from the centroidal axis of the ellipse.

Returns
=======

S_x, S_y: numbers or SymPy expressions
          S_x is the section modulus with respect to the x-axis
          S_y is the section modulus with respect to the y-axis
          A negative sign indicates that the section modulus is
          determined for a point below the centroidal axis.

Examples
========

>>> from sympy import Symbol, Ellipse, Circle, Point2D
>>> d = Symbol('d', positive=True)
>>> c = Circle((0, 0), d/2)
>>> c.section_modulus()
(pi*d**3/32, pi*d**3/32)
>>> e = Ellipse(Point2D(0, 0), 2, 4)
>>> e.section_modulus()
(8*pi, 4*pi)
>>> e.section_modulus((2, 2))
(16*pi, 4*pi)

References
==========

.. [1] https://en.wikipedia.org/wiki/Section_modulus

r   r   )rG   r   maxr#   r<   r;   r6  )r?   r2  x_cy_cx_miny_minx_maxy_maxr<   r;   r9  S_xS_ys                rB   section_modulusEllipse.section_modulus  s    X ;;=)-&E%CK-ACK-A ENE#A#A224Aq Aq xrE   rW   )NNNN)g      ?z#66cc99)r   )r;   r<   Nr;   r<   rN   r   r   r   N).__name__
__module____qualname____firstlineno____doc__rC   rK   rP   rb   rm   propertyrq   rv   r   r   r   rG   r   rd   r   r:   r   r   r   rH   r   r   ru   r   r   r   r   r   r   r  r  r  r  r"  r   rI   r6  r:  rF  __static_attributes____classcell__)rQ   s   @rB   r6   r6   )   s   ?BF" DH$OL@&   4 46':R < <( \ \  2 A A, 0 0(3,jJXM@ *9 *9X 9 96  2PNdBLH , ,\ , ,\ND` 4 46 #9 #9JD L< 66;p+CZa0B*NL`  4. b3D< <rE   r6   c                   x    \ rS rSrSrS rSS jr\S 5       rSS jr	S r
\S 5       rS	 rSS jr\S 5       rSrg
)r`   i  a3  A circle in space.

Constructed simply from a center and a radius, from three
non-collinear points, or the equation of a circle.

Parameters
==========

center : Point
radius : number or SymPy expression
points : sequence of three Points
equation : equation of a circle

Attributes
==========

radius (synonymous with hradius, vradius, major and minor)
circumference
equation

Raises
======

GeometryError
    When the given equation is not that of a circle.
    When trying to construct circle from incorrect parameters.

See Also
========

Ellipse, sympy.geometry.point.Point

Examples
========

>>> from sympy import Point, Circle, Eq
>>> from sympy.abc import x, y, a, b

A circle constructed from a center and radius:

>>> c1 = Circle(Point(0, 0), 5)
>>> c1.hradius, c1.vradius, c1.radius
(5, 5, 5)

A circle constructed from three points:

>>> c2 = Circle(Point(0, 0), Point(1, 1), Point(1, 0))
>>> c2.hradius, c2.vradius, c2.radius, c2.center
(sqrt(2)/2, sqrt(2)/2, sqrt(2)/2, Point2D(1/2, 1/2))

A circle can be constructed from an equation in the form
`ax^2 + by^2 + gx + hy + c = 0`, too:

>>> Circle(x**2 + y**2 - 25)
Circle(Point2D(0, 0), 5)

If the variables corresponding to x and y are named something
else, their name or symbol can be supplied:

>>> Circle(Eq(a**2 + b**2, 25), x='a', y=b)
Circle(Point2D(0, 0), 5)
c           	         UR                  S[        R                  5      n[        U5      S:X  Ga  [	        US   [
        [        45      (       a  UR                  SS5      nUR                  SS5      nUS   R                  5       n[	        U[        5      (       a  UR                  UR                  -
  n[        XF5      n[        XV5      n [        XdS-  US-  XE5      u  pxpn[        R                  Xx4;   d  Xx:w  a  [        S5      eU	* U-  S-  nU
* U-  S-  nUS-  US-  -   X-  -
  n[!        X4[#        U5      US9$ S	u  p[        U5      S
:X  aS  U Vs/ s H  n[%        USUS9PM     nn['        U6 n[	        U[&        5      (       d  U$ UR(                  n	UR*                  nO8[        U5      S:X  a)  [%        US   SUS9n	US   n [%        USUS9R,                  nU	b#  Ub   US:X  a  U	$ [.        R0                  " X	U40 UD6$ [        S5      e! [         a    [        S5      ef = fs  snf ! [         a    [        S5      ef = f)Nevaluater   r   r;   r<   r1   z+The given equation is not that of a circle.rT  )NNr   )rU   rT  z-Circle with imaginary radius is not permittedz)Circle.__new__ received unknown arguments)getr	   rT  rZ   r9   r   r   r   lhsrhsr&   r-   r[   r   r   r>   r`   r   r"   Trianglecircumcentercircumradiusr;   r   rb   )rc   r   re   rT  r;   r<   r:   r   r   rj   decenter_xcenter_yr2r
  r   s                    rB   rb   Circle.__new__  sG   ::j*;*D*DEt9>ja4*==

3$A

3$AAw~~'H(B''#<<(,,6Q!AQ!AS -h1adA IaA vv!16#$QRRr!tAvHr!tAvHA+(A+.4B8.R8LL DA4yA~DHIDqaQ:DIdO!!X..HNNNNTa$q'q8<GYaX688A I6H%--caB6BB KLLI  S#$QRRS J " Y'(WXXYs   H H&H+ H#+Ic                     U R                   u  p4[        U5      nUR                  " SSU0UD6nUR                  " SSU0UD6nU R                  X4SS9$ )Nr   FrU  rW   )r   r0   evalfr  )r?   r   optionsr   r
  dpss         rB   _eval_evalfCircle._eval_evalf8  sV    		$XX''w'GG%c%W%yyy//rE   c                 B    S[         R                  -  U R                  -  $ )zThe circumference of the circle.

Returns
=======

circumference : number or SymPy expression

Examples
========

>>> from sympy import Point, Circle
>>> c1 = Circle(Point(3, 4), 6)
>>> c1.circumference
12*pi

r1   )r   r   r   rp   s    rB   r   Circle.circumference?  s    $ 144x$++%%rE   c                     [        USS9n[        USS9nXR                  R                  -
  S-  nX R                  R                  -
  S-  nX4-   U R                  S-  -
  $ )aJ  The equation of the circle.

Parameters
==========

x : str or Symbol, optional
    Default value is 'x'.
y : str or Symbol, optional
    Default value is 'y'.

Returns
=======

equation : SymPy expression

Examples
========

>>> from sympy import Point, Circle
>>> c1 = Circle(Point(0, 0), 5)
>>> c1.equation()
x**2 + y**2 - 25

Tr3   r1   )r   rG   r;   r<   ru   r   s        rB   r:   Circle.equationS  s[    2 AD!AD!++--!#++--!#wQ&&rE   c                 ,    [         R                  X5      $ )a  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)
[Point2D(5, 0)]
>>> c1.intersection(Ray(p1, p2))
[Point2D(5*sqrt(2)/2, 5*sqrt(2)/2)]
>>> c1.intersection(Line(p2, p3))
[]

)r6   r   rJ   s     rB   r   Circle.intersectionr  s    < ##D,,rE   c                      U R                   S   $ )a  The radius of the circle.

Returns
=======

radius : number or SymPy expression

See Also
========

Ellipse.major, Ellipse.minor, Ellipse.hradius, Ellipse.vradius

Examples
========

>>> from sympy import Point, Circle
>>> c1 = Circle(Point(3, 4), 6)
>>> c1.radius
6

r   r   rp   s    rB   r   Circle.radius  s    . yy|rE   c                 t    U R                   nUR                  U5      nU R                  X R                  * 5      $ )zOverride GeometryEntity.reflect since the radius
is not a GeometryEntity.

Examples
========

>>> from sympy import Circle, Line
>>> Circle((0, 1), 1).reflect(Line((0, 0), (1, 1)))
Circle(Point2D(1, 0), -1)
)rG   r  r  r   )r?   r  rj   s      rB   r  Circle.reflect  s/     KKIIdOyy[[L))rE   Nc                    U R                   nU(       aJ  [        USS9nU R                  " U* R                  6 R	                  X5      R                  " UR                  6 $ UR	                  X5      nX4 Vs/ s H  n[        U5      PM     snu  pX:X  a  U R                  XAU R                  -  5      $ U R                  =pg[        XFU-  Xr-  S9$ s  snf )zOverride GeometryEntity.scale since the radius
is not a GeometryEntity.

Examples
========

>>> from sympy import Circle
>>> Circle((0, 0), 1).scale(2, 2)
Circle(Point2D(0, 0), 2)
>>> Circle((0, 0), 1).scale(2, 4)
Ellipse(Point2D(0, 0), 2, 4)
r1   rT   r   )	rG   r"   r!  r   r"  absr  r   r6   )r?   r;   r<   r   rj   r   rk   rl   s           rB   r"  Circle.scale  s     KKrq!B>>RC::.44Q:DDbggNNGGAM!"'1A'699Q$++..qA#qs33	 (s   4Cc                 ,    [        U R                  5      $ )a  
This Ellipse property is an alias for the Circle's radius.

Whereas hradius, major and minor can use Ellipse's conventions,
the vradius does not exist for a circle. It is always a positive
value in order that the Circle, like Polygons, will have an
area that can be positive or negative as determined by the sign
of the hradius.

Examples
========

>>> from sympy import Point, Circle
>>> c1 = Circle(Point(3, 4), 6)
>>> c1.vradius
6
)rs  r   rp   s    rB   rI   Circle.vradius  s    & 4;;rE   rW   )   rH  rI  )rJ  rK  rL  rM  rN  rb   rf  rO  r   r:   r   r   r  r"  rI   rP  rW   rE   rB   r`   r`     se    =~1Mf0 & &&'>-@  0*40    rE   r`   )r   rY  )PrN  sympy.core.exprr   sympy.core.relationalr   
sympy.corer   r   r   sympy.core.evalfr   sympy.core.parametersr	   sympy.core.logicr
   sympy.core.numbersr   r   sympy.core.sortingr   sympy.core.symbolr   r   r   sympy.simplify.simplifyr   sympy.simplify.trigsimpr   (sympy.functions.elementary.miscellaneousr   r   (sympy.functions.elementary.trigonometricr   r   *sympy.functions.special.elliptic_integralsr   entityr   r   
exceptionsr   r  r   r   r   r   r    r!   r2  r"   r#   r$   utilr%   r&   sympy.polysr'   r(   r)   sympy.polys.polyutilsr*   r+   sympy.solversr,   sympy.solvers.solvesetr-   sympy.utilities.miscr.   r/   mpmath.libmp.libmpfr0   r  ranger;   r<   r6   r`   polygonr   rY  )r   s   0rB   <module>r     s    ! $ % %  3 ' + & C C , , > = A / % I I * *  : : 6  0 6 + 388<8aoD)8<1Yk Yx,` W ` F	 ' &E6 =s   D