403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/sympy/vector/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/sympy/vector/__pycache__/implicitregion.cpython-312.pyc
�

M�Zd?����ddlmZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZmZmZmZdd	lmZdd
lmZddlmZmZmZddlmZdd
lmZddl m!Z!Gd�de�Z"d�Z#y)�)�Rational)�S)�symbols)�sign)�sqrt)�gcd)�
Complement)�Basic�Tuple�diff�expand�Eq�Integer)�ordered)�_symbol)�solveset�nonlinsolve�diophantine)�total_degree)�Point)�corec�x��eZdZdZ�fd�Zed��Zed��Zed��Zd�Z	d�Z
d�Zd	�Zd
�Z
dd�Z�xZS)
�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���t|t�st|�}t|t�r|j|jz
}t
�|�|||�S�N)�
isinstancerr�lhs�rhs�super�__new__)�cls�	variables�equation�	__class__s   ��=/usr/lib/python3/dist-packages/sympy/vector/implicitregion.pyr zImplicitRegion.__new__9sF����)�U�+��y�)�I��h��#��|�|�h�l�l�2�H��w��s�I�x�8�8�c� �|jdS)Nr��args��selfs r%r"zImplicitRegion.variablesB����y�y��|�r&c� �|jdS)N�r(r*s r%r#zImplicitRegion.equationFr,r&c�,�t|j�Sr)rr#r*s r%�degreezImplicitRegion.degreeJs���D�M�M�*�*r&c��|j}t|j�dk(r6tt	||jdt
j���dfSt|j�dk(rh|jdk(rYt|j|�x}\}}}}}}|dzd|z|zk(r|j|�\}	}
|	|
fS|j|�\}	}
|	|
fSt|j�dk(r�|j\}}}
tdd�D]�}	tdd�D]y}
t	|j||	||
i�|jdt
j��jr�J|	|
tt	|j||	||
i���dfccS��t|j��dk7rt|j�dSt��)	a0
        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

        r.r)�domain���i�����
)r#�lenr"�listrr�Realsr0�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_pointzImplicitRegion.regular_pointNs���6�=�=���t�~�~��!�#���(�D�N�N�1�,=�a�g�g�N�O�PQ�R�T�T�
����
 �A�
%��{�{�a��,7�����,Q�Q��)��A�q�!�Q���a�4�1�Q�3�q�5�=�#?�4�#?�#?��#H�L�E�5��e�|�#�$?�4�#>�#>��#G�L�E�5��e�|�#��t�~�~��!�#��n�n�G�A�q�!��s�B��
f��"�3��^�f�E�#�H�M�M�1�e�Q��2F�$G����XY�IZ�cd�cj�cj�k�t�t� %�u�d�8�H�M�M�1�e�UV�X]�J^�<_�3`�.a�bc�.d�e�e�f�
f�
�t�#�#�%�&�!�+���,�,�.�/��2�2�!�#�#r&c��||fdk7xr ||fdk7xr|dzd|z|zk(xr||fdk7}|std��|dk7r=d|z|zd|z|zz
d|z|z|dzz
}	}|dk7r|	|z}
|||
zzd|zz}nDd}nA|dk7r<d|z|zd|z|zz
d|z|z|dzz
}	}|dk7r|	|z}|||zzd|zz}
nd}|r
fStd��)N)rrr3r4�*Rational Point on the conic does not existrF)�
ValueError)r+rCrDrErFrGrH�ok�d_dash�f_dashrJrIs            r%r;z&ImplicitRegion._regular_point_parabola�s1���Q��6�!�]�q�!�f��&6�]�1�a�4�1�Q�3�q�5�=�]�a�QR�V�W]�M]�B�� �!M�N�N��A�v�"#�A�#�a�%�!�A�#�a�%�-��1��Q���A������Q�;�#�G�F�N�E��!�E�'�k�N�A�a�C�0�E��B��a��"#�A�#�a�%�!�A�#�a�%�-��1��Q���A������Q�;�#�G�F�N�E��!�E�'�k�N�A�a�C�0�E��B���e�|�#� �!M�N�Nr&c�J
�/�d|z|z|dzz
}|}|std��|dk(r|dk(rd}	d||z||zz
z}
n�|dk7rM|}	d|dzz|dzzd|z|z|z|zz
d|z|z|dzzzd|dzz|z|zzd|z|dzz|zz
}
n.|}	d|dzz|dzzd|z|z|z|zz
d|dzz|z|zz}
|
dk7xr
|	dkDxr|
dk}|std��t|	�jd�}	t|
�jd�}
|	j|	j}}|
j|
j}}
t||�}||z|z}||z|z}|
|z|z}t
|�tt|�d�z}t||z�}t
|�tt|�d�z}t||z�}t
|�tt|�d�z}t||z�}tt||�|�}||z}||z}||z}t||�}||z}||z}||z}t||�}||z}||z}||z}t||�}||z}||z}||z}td�\}}}||dzz||dzzz||dzzz}t|�} t| �dk(rtd��d	}!| D�]�}"t|"�j}#|#D�$cic]}$|$d
��c}$�/|"d}%|%dk(rd}!�4t|%t t"f�r�K|%j}&t|&�dk(rht%t'|&��}'t)t*j,t/t1|%d�|'t*j,��}(t%t'|(���/|'<t|&�dk(r�t3t5|&��\}'})t*j,D]{}*|%j7|'|*�}+t)t*j,t/t1|+d�|)t*j,��},|,j8r�_|*�/|'<t%t'|,���/|)<nt|#�dk7rt;�/fd
�|"D��\}}}n|"\}}}d	}!n|!rtd��||z|z}||z|z}||z|z}||z}||z}|dk(r+|dk(r&||zd|zz
d|zz}-||z
d|zz
d|zz}.|-|.fS|dk7r)|d|z|zz
||zz|	z}-|||-zz
|z
d|zz}.|-|.fS|d|z|zz
||zz|	z}.|||.zz
|z
d|zz}-|-|.fScc}$w)Nr4r3rPr����lJ)�zx y zFr5Tr.c3�@�K�|]}|j�����y�wr�r>��.0�s�reps  �r%�	<genexpr>z8ImplicitRegion._regular_point_ellipse.<locals>.<genexpr>s�����'A�����s��'A���)rQr�limit_denominator�p�qrrr�absrrrr7r�free_symbolsr�intr�next�iterr	r�Integersrrr8rr>r?�tuple)0r+rCrDrErFrGrH�DrR�K�L�k1�k2�l1�l2�g�a1�b1�c1�a2�r1�b2�r2�c2�r3�g1�g2�g3rKrLrM�eq�	solutions�flag�sol�symsr\�sol_z�syms_zra�p_valuesrb�i�
subs_sol_z�q_valuesrIrJr]s0                                               @r%r<z%ImplicitRegion._regular_point_ellipse�s�����!��A���1���A��B�� �!M�N�N��A�v�!�q�&����q��s�Q�q�S�y�M���a�����a��d�F�1�a�4�K�!�A�#�a�%��'�!�)�+�a��c�!�e�A�q�D�j�8�1�Q��T�6�!�8�A�:�E��1��Q�PQ�T�	�RS��S�����a��d�F�1�a�4�K�!�A�#�a�%��'�!�)�+�a��1��f�Q�h�q�j�8���a��0��A���!�a�%�0�B�� �!M�N�N����-�-�f�5�A����-�-�f�5�A��S�S�!�#�#��B��S�S�!�#�#��B��B���A��R�%���B��R�%���B��b�5��!��B��b��$�s�2�w��*�*�B��b��e��B��b��$�s�2�w��*�*�B��b��e��B��b��$�s�2�w��*�*�B��b��e��B��C��B�K��$�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�&�G�A�q�!��A�q�D��2�a��d�7�"�R��1��W�,�B�#�B��I��9�~��"� �!M�N�N��D� �"
���c�{�/�/��%)�*��q�!�t�*���A����A�:��D��!�%�#�w��8�"�/�/�F��6�{�a�'� ��f��.��#-�a�j�j�(�2�e�Q�<�QR�TU�T^�T^�:_�#`��!%�d�8�n�!5��A���6�{�a�'�#�G�F�O�4���1�!"���&�A�).���A�q�)9�J�'1�!�*�*�h�r�*�VW�GX�Z[�]^�]g�]g�>h�'i�H�#+�#4�#4�)*��A��)-�d�8�n�)=��A�� %�&��4�y�A�~�"'�'A�S�'A�"A���1�a�$'���1�a� �D��E"
�H� �!M�N�N��2��r�	�A��2��r�	�A��2��r�	�A��!��A��!��A��A�v�!�q�&��Q���1���q��s�+���Q���1���q��s�+���%�<���a���Q�q�S��U��Q�q�S��!�+���Q�u�W��q��1�Q�3�/��
�%�<���Q�q�S��U��Q�q�S��!�+���Q�u�W��q��1�Q�3�/���%�<���k+s�
T c��|jg}|jD]}|t|j|�gz
}�t|t	|j��S)a�
        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rr8)r+�eq_list�vars   r%r@zImplicitRegion.singular_pointssR��"�=�=�/���>�>�	2�C���T�]�]�C�0�1�1�G�	2��7�D����$8�9�9r&c��t|t�r|j}|j}t	|j
�D]\}}|j
||||z�}�t|�}t|j�dk7r0|j}t|D�cgc]
}t|���c}�}|S|}t|�}|Scc}w)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

        r)rrr)r#�	enumerater"r>r
r7�minr)r+�point�modified_eqr�r��terms�term�ms        r%�multiplicityzImplicitRegion.multiplicity2s���&�e�U�#��J�J�E��m�m������/�	@�F�A�s�%�*�*�3��e�A�h��?�K�	@��[�)���{��� �A�%��$�$�E��E�:�D�\�$�'�:�;�A�
�� �E��U�#�A����;s�Cc�p��|j}|j}|dk(rht|j�dk(r|fSt|j�dk(r+|j\}}t	t||��d}||fSt
��d}|dk(rN|�|}nIt|j��dk7rt	|j��d}n|j�}t|j��dk7rw|j�}	|	D]b}
t|
�j}|D�cic]}|d��c}�t|�dk7rt�fd�|
D��}
|j|
�|dz
k(s�`|
}nt|�dk(r
t
��|}
t|j�D]\}}|
j||||z�}
�t|
�}
dx}}|
j D]}t#|�|k(r||z
}�||z
}�d|z}t%|t�s|f}t|j�dk(r�|d}|dk(rt'dd	�
�}n
t'dd	�
�}t'|d	�
�}|j|jd||jd|i�}|j|jd||jd|i�}|||zzj|d�|dz}|||zzj|d�|dz}||fSt|j�dk(�r|\}}d|vrt'd
d	�
�}n
t'dd	�
�}t'|d	�
�}t'|d	�
�}|j|jd||jd||jd|i�}|j|jd||jd||jd|i�}|||zzj|d�|dz}|||zzj|d�|dz}|||zzj|d�|dz}|||fSt
��cc}w)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

        r.r3r�c3�@�K�|]}|j�����y�wrrYrZs  �r%r^z:ImplicitRegion.rational_parametrization.<locals>.<genexpr>�s�����!>�!�!�&�&��+�!>�r_rVr\�s_T)�realr5�r�r_)r#r0r7r"r8rrAr@rNrrdrir�r�r>r
r)rrr)r+�
parameters�	reg_pointr#r0rKrL�y_parr�r@�spointr�r\r�r�r��hn�hn_1r��
parameter1�t�x_par�
parameter2r��z_parr]s                         @r%�rational_parametrizationz'ImplicitRegion.rational_parametrizationWsK���^�=�=�������Q�;��4�>�>�"�a�'� �{�"��T�^�^�$��)��~�~���1��X�h��2�3�A�6���%�x��)�+�+����Q�;��$�!���t�+�+�-�.�!�3� ��!5�!5�!7�8��;�E� �.�.�0�E��t�#�#�%�&�!�+�"�2�2�4�O�)�	
���f�~�2�2��%)�*��q�!�t�*���t�9��>�!�!>�v�!>�>�6��$�$�V�,���
�:�"�E��	
��u�:��?�%�'�'��� ����/�	@�F�A�s�%�*�*�3��e�A�h��?�K�	@��[�)���
��T��$�$�	�D��D�!�V�+��d�
������		��$�w���*�e�,�$��J��t�~�~��!�#�#�A��J��S� ��D�t�,���C�d�+���
��.�A����$�.�.��+�Q����q�0A�1�E�F�B��9�9�d�n�n�Q�/��D�N�N�1�4E�q�I�J�D���R��[�&�&�q�!�,�u�Q�x�7�E���R��[�&�&�q�!�,�u�Q�x�7�E��%�<��
����
 �A�
%�%/�"�J�
��j� ��D�t�,���C�d�+���
��.�A��
��.�A����$�.�.��+�Q����q�0A�1�d�n�n�UV�FW�YZ�[�\�B��9�9�d�n�n�Q�/��D�N�N�1�4E�q�$�.�.�YZ�J[�]^�_�`�D���R��[�&�&�q�!�,�u�Q�x�7�E���R��[�&�&�q�!�,�u�Q�x�7�E���R��[�&�&�q�!�,�u�Q�x�7�E��%��&�&�!�#�#��M+s�#
P3))r�r\N)�__name__�
__module__�__qualname__�__doc__r �propertyr"r#r0rNr;r<r@r�r��
__classcell__)r$s@r%rrsn���&�N9����������+��+�5$�nO�4z �x:�.#�JT$r&rc��t|�dk7r
t��|d}|d}t|�}|j|dz�}|j||z�}|j|dz�}|j|d�j|d�}|j|d�j|d�}|j|d�j|d�}	||||||	fS)Nr3rr.)rrQr
�coeff)
r"r#rKrLrCrDrErFrGrHs
          r%r:r:�s����H���"��l���!��A��!��A��h��H����q�!�t��A����q��s��A����q�!�t��A����q�!��"�"�1�a�(�A����q�!��"�"�1�a�(�A����q�!��"�"�1�a�(�A��a��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
rrr
rr�sympy.core.sortingrr�
sympy.solversrrr�sympy.polysr�sympy.geometryr�sympy.ntheory.factor_rrr:r�r&r%�<module>r�sI��'�"�%�5�9�%�&�>�>�&�%�<�<�$� �&�Z$�U�Z$�x
r&

Youez - 2016 - github.com/yon3zu
LinuXploit