Ë
    7^(h,  ã                   óÆ  — d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
 d dlmZ d dlmZ d dlmZmZmZmZmZ d d	lmZ  G d
„ de	«      Zed„ «       Zej3                  e«      d„ «       Zej3                  e«      d„ «       Zej3                  e«      dd„«       Zej3                  e«      dd„«       Zej3                  e«      dd„«       Zej3                  e«      dd„«       Zy)é    )Úsingledispatch)Úpi)Útan)Útrigsimp)ÚBasicÚTuple)Ú_symbol)Úsolve)ÚPointÚSegmentÚCurveÚEllipseÚPolygon)ÚImplicitRegionc                   ób   ‡ — e Zd ZdZˆ fd„Zed„ «       Zed„ «       Zed„ «       Zed„ «       Z	ˆ xZ
S )ÚParametricRegiona  
    Represents a parametric region in space.

    Examples
    ========

    >>> from sympy import cos, sin, pi
    >>> from sympy.abc import r, theta, t, a, b, x, y
    >>> from sympy.vector import ParametricRegion

    >>> ParametricRegion((t, t**2), (t, -1, 2))
    ParametricRegion((t, t**2), (t, -1, 2))
    >>> ParametricRegion((x, y), (x, 3, 4), (y, 5, 6))
    ParametricRegion((x, y), (x, 3, 4), (y, 5, 6))
    >>> ParametricRegion((r*cos(theta), r*sin(theta)), (r, -2, 2), (theta, 0, pi))
    ParametricRegion((r*cos(theta), r*sin(theta)), (r, -2, 2), (theta, 0, pi))
    >>> ParametricRegion((a*cos(t), b*sin(t)), t)
    ParametricRegion((a*cos(t), b*sin(t)), t)

    >>> circle = ParametricRegion((r*cos(theta), r*sin(theta)), r, (theta, 0, pi))
    >>> circle.parameters
    (r, theta)
    >>> circle.definition
    (r*cos(theta), r*sin(theta))
    >>> circle.limits
    {theta: (0, pi)}

    Dimension of a parametric region determines whether a region is a curve, surface
    or volume region. It does not represent its dimensions in space.

    >>> circle.dimensions
    1

    Parameters
    ==========

    definition : tuple to define base scalars in terms of parameters.

    bounds : Parameter or a tuple of length 3 to define parameter and corresponding lower and upper bound.

    c                 óh  •— d}i }t        |t        «      st        |Ž }|D ]Q  }t        |t        t        f«      r3t        |«      dk7  rt	        d«      ‚||d   fz  }|d   |d   f||d   <   ŒL||fz  }ŒS t        |t        t        f«      s|f}t        ‰| �  | t        |Ž g|¢­Ž }||_        ||_        |S )N© é   z?Tuple should be in the form (parameter, lowerbound, upperbound)r   é   é   )	Ú
isinstancer   ÚtupleÚlenÚ
ValueErrorÚsuperÚ__new__Ú_parametersÚ_limits)ÚclsÚ
definitionÚboundsÚ
parametersÚlimitsÚboundÚobjÚ	__class__s          €ú[/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/sympy/vector/parametricregion.pyr   zParametricRegion.__new__6   sÏ   ø€ Øˆ
Øˆä˜&¤%Ô(Ü˜F�^ˆFàò 	'ˆEÜ˜%¤%¬ Ô0Ü�u“: ’?Ü$Ð%fÓgÐgØ˜u Q™x˜kÑ)�
Ø$)¨!¡H¨e°A©hÐ#7��u˜Q‘xÒ à˜u˜hÑ&‘
ð	'ô ˜*¤u¬e nÔ5Ø$˜ˆJä‰g‰o˜c¤5¨*Ð#5Ð?¸Ò?ˆØ$ˆŒØˆŒàˆ
ó    c                 ó    — | j                   d   S ©Nr   )Úargs©Úselfs    r(   r!   zParametricRegion.definitionO   s   € à�y‰y˜‰|Ðr)   c                 ó   — | j                   S ©N)r   r-   s    r(   r$   zParametricRegion.limitsS   s   € à�|‰|Ðr)   c                 ó   — | j                   S r0   )r   r-   s    r(   r#   zParametricRegion.parametersW   s   € à×ÑÐr)   c                 ó,   — t        | j                  «      S r0   )r   r$   r-   s    r(   Ú
dimensionszParametricRegion.dimensions[   s   € ä�4—;‘;ÓÐr)   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr!   r$   r#   r3   Ú__classcell__)r'   s   @r(   r   r      s^   ø„ ñ(ôRð2 ñó ðð ñó ðð ñ ó ð ð ñ ó ô r)   r   c                 ó   — t        d«      ‚)aN  
    Returns a list of ParametricRegion objects representing the geometric region.

    Examples
    ========

    >>> from sympy.abc import t
    >>> from sympy.vector import parametric_region_list
    >>> from sympy.geometry import Point, Curve, Ellipse, Segment, Polygon

    >>> p = Point(2, 5)
    >>> parametric_region_list(p)
    [ParametricRegion((2, 5))]

    >>> c = Curve((t**3, 4*t), (t, -3, 4))
    >>> parametric_region_list(c)
    [ParametricRegion((t**3, 4*t), (t, -3, 4))]

    >>> e = Ellipse(Point(1, 3), 2, 3)
    >>> parametric_region_list(e)
    [ParametricRegion((2*cos(t) + 1, 3*sin(t) + 3), (t, 0, 2*pi))]

    >>> s = Segment(Point(1, 3), Point(2, 6))
    >>> parametric_region_list(s)
    [ParametricRegion((t + 1, 3*t + 3), (t, 0, 1))]

    >>> p1, p2, p3, p4 = [(0, 1), (2, -3), (5, 3), (-2, 3)]
    >>> poly = Polygon(p1, p2, p3, p4)
    >>> parametric_region_list(poly)
    [ParametricRegion((2*t, 1 - 4*t), (t, 0, 1)), ParametricRegion((3*t + 2, 6*t - 3), (t, 0, 1)),     ParametricRegion((5 - 7*t, 3), (t, 0, 1)), ParametricRegion((2*t - 2, 3 - 2*t),  (t, 0, 1))]

    z?SymPy cannot determine parametric representation of the region.)r   )Úregs    r(   Úparametric_region_listr<   `   s   € ôF ÐVÓ
WÐWr)   c                 ó.   — t        | j                  «      gS r0   )r   r,   )r&   s    r(   Ú_r>   †   s   € ä˜SŸX™XÓ&Ð'Ð'r)   c                 ó~   — | j                  | j                  «      j                  }| j                  }t	        ||«      gS r0   )Úarbitrary_pointÚ	parameterr,   r$   r   )r&   r!   r"   s      r(   r>   r>   ‹   s5   € à×$Ñ$ S§]¡]Ó3×8Ñ8€JØ�Z‰Z€FÜ˜Z¨Ó0Ð1Ð1r)   c                 ó„   — | j                  |«      j                  }t        |d¬«      }|ddt        z  f}t	        ||«      gS )NT©Úrealr   r   )r@   r,   r	   r   r   )r&   rA   r!   Útr"   s        r(   r>   r>   ’   sC   € à×$Ñ$ YÓ/×4Ñ4€JÜ�	 Ô%€AØ��A”b‘Dˆ\€FÜ˜Z¨Ó0Ð1Ð1r)   c                 óÈ  — t        |d¬«      }| j                  |«      j                  }t        dd«      D ]„  }t	        ||   | j
                  d   j                  |   z
  |«      }t	        ||   | j
                  d   j                  |   z
  |«      }t        |«      dk(  sŒjt        |«      dk(  sŒy||d   |d   f} n | j                  |«      j                  }t        |«      gS )NTrC   r   r   r   )r	   r@   r,   Úranger
   Úpointsr   r   )	r&   rA   rE   r!   ÚiÚlower_boundÚupper_boundr"   Údefinition_tuples	            r(   r>   r>   š   sã   € ä�	 Ô%€AØ×$Ñ$ QÓ'×,Ñ,€Jä�1�a‹[ò ˆÜ˜J q™M¨C¯J©J°q©M×,>Ñ,>¸qÑ,AÑAÀ1ÓEˆÜ˜J q™M¨C¯J©J°q©M×,>Ñ,>¸qÑ,AÑAÀ1ÓEˆäˆ{Ó˜qÓ ¤S¨Ó%5¸Ó%:Ø˜ A™¨°A©Ð6ˆFÙðð ×*Ñ*¨9Ó5×:Ñ:ÐÜÐ-¨vÓ6Ð7Ð7r)   c                 ó\   — | j                   D �cg c]  }t        ||«      d   ‘Œ }}|S c c}w r+   )Úsidesr<   )r&   rA   ÚsideÚls       r(   r>   r>   «   s1   € à@CÇ	Á	ÖJ¸Ô	  iÓ	0°Ó	3ÐJ€AÐJØ€Hùò 	Ks   �)c                 óf  — | j                  |«      }g }t        t        | j                  «      dz
  «      D ]a  }t	        ||   d¬«      }|D �cg c])  }t        |j                  |t        |dz  «      «      «      ‘Œ+ }}|j                  |ddt        z  f«       Œc t        |Ž }t        |g|¢­Ž gS c c}w )Nr   TrC   r   r   )Úrational_parametrizationrG   r   Ú	variablesr	   r   Úsubsr   Úappendr   r   r   )r&   r#   r!   r"   rI   rA   Úelems          r(   r>   r>   ±   s±   € à×-Ñ-¨jÓ9€JØ€Fä”3�s—}‘}Ó%¨Ñ)Ó*ò -ˆä˜J q™M°Ô5ˆ	ØS]Ö^È4”h˜tŸy™y¨´C¸	À!¹Ó4DÓEÕFÐ^ˆ
Ð^Ø�‰�y ! Q¤r¡TÐ*Õ,ð	-ô ˜
Ð#€JÜ˜ZÐ1¨&Ò1Ð2Ð2ùò	 _s   Á.B.N)rE   ))rE   Ús)Ú	functoolsr   Úsympy.core.numbersr   Ú(sympy.functions.elementary.trigonometricr   Úsympy.simplifyr   Ú
sympy.corer   r   Úsympy.core.symbolr	   Úsympy.solversr
   Úsympy.geometryr   r   r   r   r   Úsympy.vectorr   r   r<   Úregisterr>   r   r)   r(   ú<module>rb      s  ðÝ $Ý !Ý 8Ý #ß #Ý %Ý ß BÕ BÝ 'ôQ �uô Q ðh ñ"Xó ð"XðJ × Ñ  Ó'ñ(ó (ð(ð × Ñ  Ó'ñ2ó (ð2ð × Ñ  Ó)ò2ó *ð2ð × Ñ  Ó)ò8ó *ð8ð  × Ñ  Ó)òó *ðð
 × Ñ  Ó0ò3ó 1ñ3r)   