+
    i?                         ^ RI Ht ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHt ^ RIHtHtHtHtHtHt ^ R	IHt ^ R
IHt ^ RIHtHtHt ^ RIHt ^ RIHt ^ RI H!t!  ! R R]4      t"R t#R# )    )Rational)S)symbols)sign)sqrt)gcd)
Complement)BasicTuplediffexpandEqInteger)ordered)_symbol)solvesetnonlinsolvediophantinetotal_degree)Point)corec                      a a ] tR t^t oRtV 3R lt]R 4       t]R 4       t]R 4       t	R t
R tR tR	 tR
 tRR ltRtVtV ;t# )ImplicitRegiona-  
Represents an implicit region in space.

Examples
========

>>> from sympy import Eq
>>> from sympy.abc import x, y, z, t
>>> from sympy.vector import ImplicitRegion

>>> ImplicitRegion((x, y), x**2 + y**2 - 4)
ImplicitRegion((x, y), x**2 + y**2 - 4)
>>> ImplicitRegion((x, y), Eq(y*x, 1))
ImplicitRegion((x, y), x*y - 1)

>>> parabola = ImplicitRegion((x, y), y**2 - 4*x)
>>> parabola.degree
2
>>> parabola.equation
-4*x + y**2
>>> parabola.rational_parametrization(t)
(4/t**2, 4/t)

>>> r = ImplicitRegion((x, y, z), Eq(z, x**2 + y**2))
>>> r.variables
(x, y, z)
>>> r.singular_points()
EmptySet
>>> r.regular_point()
(-10, -10, 200)

Parameters
==========

variables : tuple to map variables in implicit equation to base scalars.

equation : An expression or Eq denoting the implicit equation of the region.

c                   < \        V\        4      '       g
   \        V!  p\        V\        4      '       d   VP                  VP                  ,
          p\
        SV `  WV4      # N)
isinstancer   r   lhsrhssuper__new__)cls	variablesequation	__class__s   &&&Y/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/vector/implicitregion.pyr!   ImplicitRegion.__new__9   sJ    )U++y)Ih##||hll2Hwsx88    c                (    V P                   ^ ,          # )r   argsselfs   &r&   r#   ImplicitRegion.variablesB       yy|r(   c                (    V P                   ^,          # )   r*   r,   s   &r&   r$   ImplicitRegion.equationF   r/   r(   c                ,    \        V P                  4      # r   )r   r$   r,   s   &r&   degreeImplicitRegion.degreeJ   s    DMM**r(   c                   V P                   p\        V P                  4      ^8X  d>   \        \	        WP                  ^ ,          \
        P                  R7      4      ^ ,          3# \        V P                  4      ^8X  dt   V P                  ^8X  dc   \        V P                  V4      ;pw  r4rVrxV^,          ^V,          V,          8X  d   V P                  ! V!  w  rW3# V P                  ! V!  w  rW3# \        V P                  4      ^8X  d   V P                  w  rp\        R^
4       F  p	\        R^
4       F  p
\	        VP                  WW/4      V P                  ^,          \
        P                  R7      P                  '       d   KS  W\        \	        VP                  WW/4      4      4      ^ ,          3u u # 	  K  	  \        V P                  4       4      ^ 8w  d#   \        V P                  4       ,          ^ ,          # \        4       h)a  
Returns a point on the implicit region.

Examples
========

>>> from sympy.abc import x, y, z
>>> from sympy.vector import ImplicitRegion
>>> circle = ImplicitRegion((x, y), (x + 2)**2 + (y - 3)**2 - 16)
>>> circle.regular_point()
(-2, -1)
>>> parabola = ImplicitRegion((x, y), x**2 - 4*y)
>>> parabola.regular_point()
(0, 0)
>>> r = ImplicitRegion((x, y, z), (x + y + z)**4)
>>> r.regular_point()
(-10, -10, 20)

References
==========

- Erik Hillgarter, "Rational Points on Conics", Diploma Thesis, RISC-Linz,
  J. Kepler Universitat Linz, 1996. Available:
  https://www3.risc.jku.at/publications/download/risc_1355/Rational%20Points%20on%20Conics.pdf

)domaini)r$   lenr#   listr   r   Realsr4   conic_coeff_regular_point_parabola_regular_point_ellipserangesubsis_emptysingular_pointsNotImplementedError)r-   r$   coeffsabcdefx_regy_regxyzs   &             r&   regular_pointImplicitRegion.regular_pointN   s   6 ==t~~!#(NN1,=aggNOPQRTT A%{{a,7,QQ)qQa41Q3q5=#'#?#?#HLE |# $(#>#>#GLE|#t~~!#nnGA!sB"3^E#HMM1Q2F$GXYIZcdcjcjkttt %d8HMM1UVJ^<_3`.abc.dee , (
 t##%&!+,,./22!##r(   c                   W3R8g  ;'       d7    W53R8g  ;'       d)    V^,          ^V,          V,          8H  ;'       d    W3R8g  pV'       g   \        R4      hV^ 8w  dv   ^V,          V,          ^V,          V,          ,
          ^V,          V,          V^,          ,
          rV^ 8w  d*   V	) V,          p
WBV
,          ,           ) ^V,          ,          pM~RpM{V^ 8w  du   ^V,          V,          ^V,          V,          ,
          ^V,          V,          V^,          ,
          rV^ 8w  d*   V	) V,          pWRV,          ,           ) ^V,          ,          p
MRpV'       d   XX
3# \        R4      h)r   *Rational Point on the conic does not existF)r   r   )
ValueError)r-   rD   rE   rF   rG   rH   rI   okd_dashf_dashrK   rJ   s   &&&&&&&     r&   r<   &ImplicitRegion._regular_point_parabola   s+   6!]]qf&6]]1a41Q3q5=]]aVW]M]B !MNNAv"#A#a%!A#a%-1QAQ;#GFNEE'kNAaC0EBa"#A#a%!A#a%-1QAQ;#GFNEE'kNAaC0EBe|# !MNNr(   c                  a. ^V,          V,          V^,          ,
          pTpV'       g   \        R4      hV^ 8X  d(   V^ 8X  d!   Rp	^WE,          W&,          ,
          ,          p
EMV^ 8w  d   Tp	^V^,          ,          V^,          ,          ^V,          V,          V,          V,          ,
          ^V,          V,          V^,          ,          ,           ^V^,          ,          V,          V,          ,           ^V,          V^,          ,          V,          ,
          p
MfTp	^V^,          ,          V^,          ,          ^V,          V,          V,          V,          ,
          ^V^,          ,          V,          V,          ,           p
V
^ 8g  ;'       d    V	^ 8  ;'       d    V
^ 8  '       * pV'       g   \        R4      h\        V	4      P                  R4      p	\        V
4      P                  R4      p
V	P                  V	P                  rV
P                  V
P                  r\        W4      pW,          V,          pW,          V,          pW,          ) V,          p\        V4      \        \        V4      ^4      ,          p\        VV,          4      p\        V4      \        \        V4      ^4      ,          p\        VV,          4      p\        V4      \        \        V4      ^4      ,          p\        VV,          4      p\        \        VV4      V4      pVV,          pVV,          pVV,          p\        VV4      pVV,          pVV,          pVV,          p\        VV4      pVV,          pVV,          pVV,          p\        VV4      pVV,          pVV,          pVV,          p\        R4      w  pppVV^,          ,          VV^,          ,          ,           VV^,          ,          ,           p\        V4      p \        V 4      ^ 8X  d   \        R4      hRp!V  EF  p"\        V"!  P                  p#\        P!                  V#^4      o.V"^,          p$V$^ 8X  d   Rp!KA  \#        V$\$        \&        34      '       d   K_  V$P                  p%\        V%4      ^8X  di   \)        \+        V%4      4      p&\-        \.        P0                  \3        \5        V$^ 4      V&\.        P0                  4      4      p'\)        \+        V'4      4      S.V&&   \        V%4      ^8X  d   \7        \9        V%4      4      w  p&p(\.        P0                   F  p)V$P;                  V&V)4      p*\-        \.        P0                  \3        \5        V*^ 4      V(\.        P0                  4      4      p+V+P<                  '       d   Kf  V)S.V&&   \)        \+        V+4      4      S.V(&    M	  \        V#4      ^ 8w  d8   \>        ;QJ d    . V.3R lV" 4       F  NK  	  5M! V.3R lV" 4       4      w  pppMV"w  pppRp! M	  V!'       d   \        R4      hVV,          V,          pVV,          V,          pVV,          V,          pVV,          pVV,          pV^ 8X  dV   V^ 8X  dO   VV,           ^V,          ,
          ^V,          ,          p,VV,
          ^V,          ,
          ^V,          ,          p-V,V-3# V^ 8w  dU   V^V,          V,          ,
          W%,          ,           V	,          p,VVV,,          ,
          V,
          ^V,          ,          p-V,V-3# V^V,          V,          ,
          W$,          ,           V	,          p-VVV-,          ,
          V,
          ^V,          ,          p,V,V-3# )   rR   zx y zFTc              3   D   <"   T F  qP                  S4      x  K  	  R # 5ir   r?   .0sreps   & r&   	<genexpr>8ImplicitRegion._regular_point_ellipse.<locals>.<genexpr>   s     'ASsS    l    J)) rS   r   limit_denominatorpqr   r   r   absr   r   r   r8   r   free_symbolsdictfromkeysr   intr   nextiterr	   r   Integersr   r   r9   r   r?   r@   tuple)/r-   rD   rE   rF   rG   rH   rI   DrT   KLk1k2l1l2ga1b1c1a2r1b2r2c2r3g1g2g3rL   rM   rN   eq	solutionsflagsolsymssol_zsyms_zre   p_valuesrf   i
subs_sol_zq_valuesrJ   rK   r_   s/   &&&&&&&                                       @r&   r=   %ImplicitRegion._regular_point_ellipse   s   !A1AB !MNNAv!q&qsQSyMaadF1a4K!A#a%'!)+ac!eAqDj81QT6!8A:E1QPQT	RSSadF1a4K!A#a%'!)+a1fQhqj8a00A!a%0B !MNN--f5A--f5ASS!##SS!##BA%B%B5!Bb$s2w**BbeBb$s2w**BbeBb$s2w**BbeBCBK$AABABABRBBBBBBBRBBBBBBBRBBBBBBBg&GAq!AqD2ad7"R1W,B#BI9~" !MNND c{//mmD!,AA:D!%#w88"//F6{a' f.#-ajj(2eQ<QRTUT^T^:_#`!%d8n!5A6{a'#GFO41!"A).Aq)9J'1!**hr*VWGXZ[]^]g]g>h'iH#+#4#4#4)*A)-d8n)=A % ", 4yA~"'%'AS'A%%'AS'A"A1a$'1a DE !H  !MNN2r	A2r	A2r	A!A!AAv!q&Q1qs+Q1qs+ %< aQqSUQS!+QuWq1Q3/
 %< QqSUQS!+QuWq1Q3/%<r(   c                    V P                   .pV P                   F!  pV\        V P                   V4      .,          pK#  	  \        V\	        V P                  4      4      # )aG  
Returns a set of singular points of the region.

The singular points are those points on the region
where all partial derivatives vanish.

Examples
========

>>> from sympy.abc import x, y
>>> from sympy.vector import ImplicitRegion
>>> I = ImplicitRegion((x, y), (y-1)**2 -x**3 + 2*x**2 -x)
>>> I.singular_points()
{(1, 1)}

)r$   r#   r   r   r9   )r-   eq_listvars   &  r&   rA   ImplicitRegion.singular_points  sM    " ==/>>CT]]C011G " 7D$899r(   c                ~   \        V\        4      '       d   VP                  pV P                  p\	        V P
                  4       F#  w  r4VP                  WDW,          ,           4      pK%  	  \        V4      p\        VP                  4      ^ 8w  d!   VP                  p\        R V 4       4      pV# Tp\        V4      pV# )a  
Returns the multiplicity of a singular point on the region.

A singular point (x,y) of region is said to be of multiplicity m
if all the partial derivatives off to order m - 1 vanish there.

Examples
========

>>> from sympy.abc import x, y, z
>>> from sympy.vector import ImplicitRegion
>>> I = ImplicitRegion((x, y, z), x**2 + y**3 - z**4)
>>> I.singular_points()
{(0, 0, 0)}
>>> I.multiplicity((0, 0, 0))
2

c              3   8   "   T F  p\        V4      x  K  	  R # 5ir   r   )r]   terms   & r&   r`   .ImplicitRegion.multiplicity.<locals>.<genexpr>P  s     954L&&5s   )r   r   r+   r$   	enumerater#   r?   r   r8   minr   )r-   pointmodified_eqr   r   termsms   &&     r&   multiplicityImplicitRegion.multiplicity2  s    & eU##JJEmm/FA%**3eh?K 0[){ A%$$E9599A
   EU#Ar(   c                4
  a V P                   pV P                  pV^8X  dn   \        V P                  4      ^8X  d   V3# \        V P                  4      ^8X  d-   V P                  w  rV\	        \        W64      4      ^ ,          pWW3# \        4       hRpV^8X  dW   Ve   TpMO\        V P                  4       4      ^ 8w  d"   \	        V P                  4       4      ^ ,          pMV P                  4       p\        V P                  4       4      ^ 8w  d   V P                  4       p	V	 F  p
\        V
!  P                  p\        P                  V^4      o\        V4      ^ 8w  d3   \        ;QJ d    . V3R lV
 4       F  NK  	  5M! V3R lV
 4       4      p
V P                  V
4      V^,
          8X  g   K  T
p M	  \        V4      ^ 8X  d   \        4       hTp\        V P                  4       F#  w  rVP!                  WW,          ,           4      pK%  	  \#        V4      p^ ;ppVP$                   F'  p\'        V4      V8X  d   VV,          pK  VV,          pK)  	  R	V,          p\)        V\        4      '       g   V3p\        V P                  4      ^8X  Ed   V^ ,          pVR8X  d   \+        RRR7      pM\+        RRR7      p\+        VRR7      pVP!                  V P                  ^ ,          VV P                  ^,          V/4      pVP!                  V P                  ^ ,          VV P                  ^,          V/4      pVVV,          ,          P!                  V^4      V^ ,          ,           pVVV,          ,          P!                  V^4      V^,          ,           pVV3# \        V P                  4      ^8X  Ede   Vw  ppRV9   d   \+        RRR7      pM\+        RRR7      p\+        VRR7      p\+        VRR7      pVP!                  V P                  ^ ,          VV P                  ^,          VV P                  ^,          V/4      pVP!                  V P                  ^ ,          VV P                  ^,          VV P                  ^,          V/4      pVVV,          ,          P!                  V^4      V^ ,          ,           pVVV,          ,          P!                  V^4      V^,          ,           pVVV,          ,          P!                  V^4      V^,          ,           pVVV3# \        4       h)
a  
Returns the rational parametrization of implicit region.

Examples
========

>>> from sympy import Eq
>>> from sympy.abc import x, y, z, s, t
>>> from sympy.vector import ImplicitRegion

>>> parabola = ImplicitRegion((x, y), y**2 - 4*x)
>>> parabola.rational_parametrization()
(4/t**2, 4/t)

>>> circle = ImplicitRegion((x, y), Eq(x**2 + y**2, 4))
>>> circle.rational_parametrization()
(4*t/(t**2 + 1), 4*t**2/(t**2 + 1) - 2)

>>> I = ImplicitRegion((x, y), x**3 + x**2 - y**2)
>>> I.rational_parametrization()
(t**2 - 1, t*(t**2 - 1))

>>> cubic_curve = ImplicitRegion((x, y), x**3 + x**2 - y**2)
>>> cubic_curve.rational_parametrization(parameters=(t))
(t**2 - 1, t*(t**2 - 1))

>>> sphere = ImplicitRegion((x, y, z), x**2 + y**2 + z**2 - 4)
>>> sphere.rational_parametrization(parameters=(t, s))
(-2 + 4/(s**2 + t**2 + 1), 4*s/(s**2 + t**2 + 1), 4*t/(s**2 + t**2 + 1))

For some conics, regular_points() is unable to find a point on curve.
To calulcate the parametric representation in such cases, user need
to determine a point on the region and pass it using reg_point.

>>> c = ImplicitRegion((x, y), (x  - 1/2)**2 + (y)**2 - (1/4)**2)
>>> c.rational_parametrization(reg_point=(3/4, 0))
(0.75 - 0.5/(t**2 + 1), -0.5*t/(t**2 + 1))

References
==========

- Christoph M. Hoffmann, "Conversion Methods between Parametric and
  Implicit Curves and Surfaces", Purdue e-Pubs, 1990. Available:
  https://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=1827&context=cstech

c              3   D   <"   T F  qP                  S4      x  K  	  R # 5ir   r[   r\   s   & r&   r`   :ImplicitRegion.rational_parametrization.<locals>.<genexpr>  s     "?166#;;rb   r^   s_T)realrr_ rc   )r$   r4   r8   r#   r9   r   rB   rA   rO   r   rh   ri   rj   ro   r   r   r?   r   r+   r   r   r   )r-   
parameters	reg_pointr$   r4   rL   rM   y_parr   rA   spointr   r   r   r   hnhn_1r   
parameter1r^   tx_par
parameter2r   z_parr_   s   &&&                      @r&   rational_parametrization'ImplicitRegion.rational_parametrizationW  s5   ^ ==Q;4>>"a' {"T^^$)~~Xh23A6x)++ Q;$!t++-.!3 !5!5!78;E ..0Et##%&!+"224O)f~22mmD!,t9>"U"?"?UU"?"??F$$V,
:"E * u:?%''  /FA%**3eh?K 0[)T$$DD!V+d
	 % $w*e,,$Jt~~!##AJS Dt,Cd+
.A$..+Qq0A1EFB99dnnQ/DNN14EqIJDR[&&q!,uQx7ER[&&q!,uQx7E%< A%%/"J
j Dt,Cd+
.A
.A$..+Qq0A1dnnUVFWYZ[\B99dnnQ/DNN14Eq$..YZJ[]^_`DR[&&q!,uQx7ER[&&q!,uQx7ER[&&q!,uQx7E%&&!##r(   r   ))r   r^   N)__name__
__module____qualname____firstlineno____doc__r!   propertyr#   r$   r4   rO   r<   r=   rA   r   r   __static_attributes____classdictcell____classcell__)r%   __classdict__s   @@r&   r   r      sv     &N9     + +5$nO4z x:.#JT$ T$r(   r   c                    \        V4      ^8w  d   \        4       hV ^ ,          pV ^,          p\        V4      pVP                  V^,          4      pVP                  W#,          4      pVP                  V^,          4      pVP                  V^4      P                  V^ 4      pVP                  V^4      P                  V^ 4      pVP                  V^ 4      P                  V^ 4      p	WEWgW3# )   )r   rS   r   coeff)
r#   r$   rL   rM   rD   rE   rF   rG   rH   rI   s
   &&        r&   r;   r;     s    H"l!A!AhHq!tAqsAq!tAq!""1a(Aq!""1a(Aq!""1a(Aqr(   N)$sympy.core.numbersr   sympy.core.singletonr   sympy.core.symbolr   $sympy.functions.elementary.complexesr   (sympy.functions.elementary.miscellaneousr   sympy.polys.polytoolsr   sympy.sets.setsr	   
sympy.corer
   r   r   r   r   r   sympy.core.sortingr   r   sympy.solversr   r   r   sympy.polysr   sympy.geometryr   sympy.ntheory.factor_r   r   r;   r   r(   r&   <module>r      sI    ' " % 5 9 % & > > & % < < $   &Z$U Z$xr(   