§
    OŠtj5�  ã                   óB  — d Z ddlZddlmZmZmZ 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 ddlmZmZ ddlmZ ddlmZ ddlmZm Z  ddl!m"Z"m#Z#m$Z$ ddl%m&Z& ddl'm(Z(  G d„ de&¦  «        Z) G d„ de)¦  «        Z* G d„ de)¦  «        Z+dS )aD  Geometrical Points.

Contains
========
Point
Point2D
Point3D

When methods of Point require 1 or more points as arguments, they
can be passed as a sequence of coordinates or Points:

>>> from sympy import Point
>>> Point(1, 1).is_collinear((2, 2), (3, 4))
False
>>> Point(1, 1).is_collinear(Point(2, 2), Point(3, 4))
False

é    N)ÚSÚsympifyÚExpr)ÚAdd)ÚTuple)ÚFloat)Úglobal_parameters)Ú	nsimplifyÚsimplify)ÚGeometryError)Úsqrt)Úim)ÚcosÚsin)ÚMatrix)Ú	Transpose)ÚuniqÚis_sequence)Ú
filldedentÚ	func_nameÚUndecidableé   )ÚGeometryEntity)Úprec_to_dpsc                   ó   — e Zd ZdZdZd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zd„ Zd„ Zd„ Zd)d„Zd„ Zd„ Zd„ Z ed„ ¦   «         Z!d„ Z"ed„ ¦   «         Z#ed „ ¦   «         Z$d!„ Z%ed"„ ¦   «         Z&ed#„ ¦   «         Z'ed$„ ¦   «         Z(d%„ Z)d&„ Z*ed'„ ¦   «         Z+d(S )*ÚPointaÙ  A point in a n-dimensional Euclidean space.

    Parameters
    ==========

    coords : sequence of n-coordinate values. In the special
        case where n=2 or 3, a Point2D or Point3D will be created
        as appropriate.
    evaluate : if `True` (default), all floats are turn into
        exact types.
    dim : number of coordinates the point should have.  If coordinates
        are unspecified, they are padded with zeros.
    on_morph : indicates what should happen when the number of
        coordinates of a point need to be changed by adding or
        removing zeros.  Possible values are `'warn'`, `'error'`, or
        `ignore` (default).  No warning or error is given when `*args`
        is empty and `dim` is given. An error is always raised when
        trying to remove nonzero coordinates.


    Attributes
    ==========

    length
    origin: A `Point` representing the origin of the
        appropriately-dimensioned space.

    Raises
    ======

    TypeError : When instantiating with anything but a Point or sequence
    ValueError : when instantiating with a sequence with length < 2 or
        when trying to reduce dimensions if keyword `on_morph='error'` is
        set.

    See Also
    ========

    sympy.geometry.line.Segment : Connects two Points

    Examples
    ========

    >>> from sympy import Point
    >>> from sympy.abc import x
    >>> Point(1, 2, 3)
    Point3D(1, 2, 3)
    >>> Point([1, 2])
    Point2D(1, 2)
    >>> Point(0, x)
    Point2D(0, x)
    >>> Point(dim=4)
    Point(0, 0, 0, 0)

    Floats are automatically converted to Rational unless the
    evaluate flag is False:

    >>> Point(0.5, 0.25)
    Point2D(1/2, 1/4)
    >>> Point(0.5, 0.25, evaluate=False)
    Point2D(0.5, 0.25)

    Tc           	      ó¦  — |                      dt          j        ¦  «        }|                      dd¦  «        }t          |¦  «        dk    r|d         n|}t	          |t
          ¦  «        r8d}t          |¦  «        |                      dt          |¦  «        ¦  «        k    r|S t          |¦  «        s<t          t          d 	                    t          |¦  «        ¦  «        ¦  «        ¦  «        ‚t          |¦  «        dk    r9|                      dd ¦  «        r#t          j        f|                      d¦  «        z  }t          |Ž }|                      dt          |¦  «        ¦  «        }t          |¦  «        d	k     rt          t          d
¦  «        ¦  «        ‚t          |¦  «        |k    ryd 	                    |t          |¦  «        |¦  «        }|dk    rnN|dk    rt          |¦  «        ‚|dk    rt          j        |d	¬¦  «         nt          t          d¦  «        ¦  «        ‚t#          ||d …         ¦  «        rt          d¦  «        ‚t#          d„ |D ¦   «         ¦  «        rt          d¦  «        ‚t%          d„ |D ¦   «         ¦  «        st          d¦  «        ‚|d |…         t          j        f|t          |¦  «        z
  z  z   }|r7|                     d„ |                     t*          ¦  «        D ¦   «         ¦  «        }t          |¦  «        d	k    rd|d<   t-          |i |¤ŽS t          |¦  «        dk    rd|d<   t/          |i |¤ŽS t1          j        | g|¢R Ž S )NÚevaluateÚon_morphÚignorer   r   FÚdimz<
                Expecting sequence of coordinates, not `{}`é   z[
                Point requires 2 or more coordinates or
                keyword `dim` > 1.z2Dimension of {} needs to be changed from {} to {}.ÚerrorÚwarn)Ú
stacklevelzf
                        on_morph value should be 'error',
                        'warn' or 'ignore'.z&Nonzero coordinates cannot be removed.c              3   óP   K  — | ]!}|j         ot          |¦  «        j        d u V — Œ"dS )FN)Ú	is_numberr   Úis_zero©Ú.0Úas     úR/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sympy/geometry/point.pyú	<genexpr>z Point.__new__.<locals>.<genexpr>›   s6   è è € ÐFÐF¸!ˆqŒ{Ð5�r !™uœuœ}°Ð5ÐFÐFÐFÐFÐFÐFó    z(Imaginary coordinates are not permitted.c              3   ó@   K  — | ]}t          |t          ¦  «        V — Œd S ©N)Ú
isinstancer   r)   s     r,   r-   z Point.__new__.<locals>.<genexpr>�   s,   è è € Ð7Ð7¨1•:˜a¥Ñ&Ô&Ð7Ð7Ð7Ð7Ð7Ð7r.   z,Coordinates must be valid SymPy expressions.c           	      óL   — i | ]!}|t          t          |d ¬¦  «        ¦  «        “Œ"S )T)Úrational)r   r
   )r*   Úfs     r,   ú
<dictcomp>z!Point.__new__.<locals>.<dictcomp>¦   s?   € ð &/ð &/ð &/àð •8�I a°$Ð7Ñ7Ô7Ñ8Ô8ð&/ð &/ð &/r.   TÚ_nochecké   )Úgetr	   r   Úlenr1   r   r   Ú	TypeErrorr   Úformatr   r   ÚZeror   Ú
ValueErrorÚwarningsr$   ÚanyÚallÚxreplaceÚatomsr   ÚPoint2DÚPoint3Dr   Ú__new__)ÚclsÚargsÚkwargsr   r   Úcoordsr!   Úmessages           r,   rE   zPoint.__new__m   s  € Ø—:’:˜jÕ*;Ô*DÑEÔEˆØ—:’:˜j¨(Ñ3Ô3ˆõ   ™IœI¨šN˜N��a”�°ˆõ �f�eÑ$Ô$ð 	ð ˆHÝ�6‰{Œ{˜fŸjšj¨µ°F±´Ñ<Ô<Ò<Ð<Ø�å˜6Ñ"Ô"ð 	DÝ�Jð (?ç(.ª­y¸Ñ/@Ô/@Ñ(AÔ(AñCô Cñ Dô Dð Dõ
 ˆv‰;Œ;˜!ÒÐ §
¢
¨5°$Ñ 7Ô 7ÐÝ”f�Y˜vŸzšz¨%Ñ0Ô0Ñ0ˆFå˜�ˆØ�jŠj˜¥ F¡¤Ñ,Ô,ˆåˆv‰;Œ;˜Š?ˆ?Ý�Zð )&ñ 'ô 'ñ (ô (ð (õ ˆv‰;Œ;˜#ÒÐð(ß)/ª°½¸F¹¼ÀSÑ)IÔ)Ið à˜8Ò#Ð#ØØ˜WÒ$Ð$Ý  Ñ)Ô)Ð)Ø˜VÒ#Ð#Ý”˜g°!Ð4Ñ4Ô4Ð4Ð4å ¥ð -/ñ "0ô "0ñ 1ô 1ð 1õ ˆv�c�d�dŒ|ÑÔð 	GÝÐEÑFÔFÐFÝÐFÐF¸vÐFÑFÔFÑFÔFð 	IÝÐGÑHÔHÐHÝÐ7Ð7°Ð7Ñ7Ô7Ñ7Ô7ð 	LÝÐJÑKÔKÐKð ˜˜˜”¥¤ 	¨3µ°V±´Ñ+<Ñ =Ñ=ˆð ð 	0Ø—_’_ð &/ð &/à Ÿ,š,¥uÑ-Ô-ð&/ñ &/ô &/ñ 0ô 0ˆFõ
 ˆv‰;Œ;˜!ÒÐØ!%ˆF�:ÑÝ˜FÐ- fÐ-Ð-Ð-Ý�‰[Œ[˜AÒÐØ!%ˆF�:ÑÝ˜FÐ- fÐ-Ð-Ð-õ Ô% cÐ3¨FÐ3Ð3Ð3Ð3r.   c                 óx   — t          dgt          | ¦  «        z  ¦  «        }t                                || ¦  «        S )z7Returns the distance between this point and the origin.r   )r   r9   Údistance)ÚselfÚorigins     r,   Ú__abs__zPoint.__abs__µ   s/   € å˜�s�3˜t™9œ9‘}Ñ%Ô%ˆÝ�~Š~˜f dÑ+Ô+Ð+r.   c                 ó  — 	 t                                | t          |d¬¦  «        ¦  «        \  }}n0# t          $ r# t          d                     |¦  «        ¦  «        ‚w xY wd„ t          ||¦  «        D ¦   «         }t          |d¬¦  «        S )a8  Add other to self by incrementing self's coordinates by
        those of other.

        Notes
        =====

        >>> from sympy import Point

        When sequences of coordinates are passed to Point methods, they
        are converted to a Point internally. This __add__ method does
        not do that so if floating point values are used, a floating
        point result (in terms of SymPy Floats) will be returned.

        >>> Point(1, 2) + (.1, .2)
        Point2D(1.1, 2.2)

        If this is not desired, the `translate` method can be used or
        another Point can be added:

        >>> Point(1, 2).translate(.1, .2)
        Point2D(11/10, 11/5)
        >>> Point(1, 2) + Point(.1, .2)
        Point2D(11/10, 11/5)

        See Also
        ========

        sympy.geometry.point.Point.translate

        F©r   z+Don't know how to add {} and a Point objectc                 ó8   — g | ]\  }}t          ||z   ¦  «        ‘ŒS © ©r   ©r*   r+   Úbs      r,   ú
<listcomp>z!Point.__add__.<locals>.<listcomp>Þ   s&   € Ð8Ð8Ð8¡d a¨•(˜1˜q™5‘/”/Ð8Ð8Ð8r.   )r   Ú_normalize_dimensionr:   r   r;   Úzip)rM   ÚotherÚsÚorI   s        r,   Ú__add__zPoint.__add__º   s�   € ð>	]Ý×-Ò-¨dµE¸%È%Ð4PÑ4PÔ4PÑQÔQ‰DˆAˆqˆqøÝð 	]ð 	]ð 	]ÝÐ M× TÒ TÐUZÑ [Ô [Ñ\Ô\Ð\ð	]øøøð 9Ð8­c°!°Q©i¬iÐ8Ñ8Ô8ˆÝ�V eÐ,Ñ,Ô,Ð,s	   ‚-0 °-Ac                 ó   — || j         v S r0   ©rG   ©rM   Úitems     r,   Ú__contains__zPoint.__contains__á   s   € Ø�t”yÐ Ð r.   c                 ój   ‡— t          ‰¦  «        Šˆfd„| j        D ¦   «         }t          |d¬¦  «        S )z'Divide point's coordinates by a factor.c                 ó4   •— g | ]}t          |‰z  ¦  «        ‘ŒS rS   rT   )r*   ÚxÚdivisors     €r,   rW   z%Point.__truediv__.<locals>.<listcomp>ç   s%   ø€ Ð9Ð9Ð9¨!•(˜1˜W™9Ñ%Ô%Ð9Ð9Ð9r.   FrQ   ©r   rG   r   )rM   rf   rI   s    ` r,   Ú__truediv__zPoint.__truediv__ä   s>   ø€ å˜'Ñ"Ô"ˆØ9Ð9Ð9Ð9¨t¬yÐ9Ñ9Ô9ˆÝ�V eÐ,Ñ,Ô,Ð,r.   c                 ó¤   — t          |t          ¦  «        r*t          | j        ¦  «        t          |j        ¦  «        k    rdS | j        |j        k    S )NF)r1   r   r9   rG   ©rM   rZ   s     r,   Ú__eq__zPoint.__eq__ê   sB   € Ý˜%¥Ñ'Ô'ð 	­3¨t¬y©>¬>½SÀÄ¹_¼_Ò+LÐ+LØ�5ØŒy˜EœJÒ&Ð&r.   c                 ó   — | j         |         S r0   r_   )rM   Úkeys     r,   Ú__getitem__zPoint.__getitem__ï   s   € ØŒy˜Œ~Ðr.   c                 ó*   — t          | j        ¦  «        S r0   )ÚhashrG   ©rM   s    r,   Ú__hash__zPoint.__hash__ò   s   € Ý�D”I‰ŒÐr.   c                 ó4   — | j                              ¦   «         S r0   )rG   Ú__iter__rq   s    r,   rt   zPoint.__iter__õ   s   € ØŒy×!Ò!Ñ#Ô#Ð#r.   c                 ó*   — t          | j        ¦  «        S r0   )r9   rG   rq   s    r,   Ú__len__zPoint.__len__ø   s   € Ý�4”9‰~Œ~Ðr.   c                 ój   ‡— t          ‰¦  «        Šˆfd„| j        D ¦   «         }t          |d¬¦  «        S )al  Multiply point's coordinates by a factor.

        Notes
        =====

        >>> from sympy import Point

        When multiplying a Point by a floating point number,
        the coordinates of the Point will be changed to Floats:

        >>> Point(1, 2)*0.1
        Point2D(0.1, 0.2)

        If this is not desired, the `scale` method can be used or
        else only multiply or divide by integers:

        >>> Point(1, 2).scale(1.1, 1.1)
        Point2D(11/10, 11/5)
        >>> Point(1, 2)*11/10
        Point2D(11/10, 11/5)

        See Also
        ========

        sympy.geometry.point.Point.scale
        c                 ó4   •— g | ]}t          |‰z  ¦  «        ‘ŒS rS   rT   )r*   re   Úfactors     €r,   rW   z!Point.__mul__.<locals>.<listcomp>  s%   ø€ Ð8Ð8Ð8¨•(˜1˜V™8Ñ$Ô$Ð8Ð8Ð8r.   FrQ   rg   )rM   ry   rI   s    ` r,   Ú__mul__zPoint.__mul__û   s>   ø€ õ6 ˜‘”ˆØ8Ð8Ð8Ð8¨d¬iÐ8Ñ8Ô8ˆÝ�V eÐ,Ñ,Ô,Ð,r.   c                 ó,   — |                       |¦  «        S )z)Multiply a factor by point's coordinates.)rz   )rM   ry   s     r,   Ú__rmul__zPoint.__rmul__  s   € à�|Š|˜FÑ#Ô#Ð#r.   c                 óF   — d„ | j         D ¦   «         }t          |d¬¦  «        S )zNegate the point.c                 ó   — g | ]}| ‘ŒS rS   rS   ©r*   re   s     r,   rW   z!Point.__neg__.<locals>.<listcomp>   s   € Ð(Ð(Ð(˜�1�"Ð(Ð(Ð(r.   FrQ   )rG   r   )rM   rI   s     r,   Ú__neg__zPoint.__neg__  s*   € à(Ð(˜dœiÐ(Ñ(Ô(ˆÝ�V eÐ,Ñ,Ô,Ð,r.   c                 ó    — | d„ |D ¦   «         z   S )zPSubtract two points, or subtract a factor from this point's
        coordinates.c                 ó   — g | ]}| ‘ŒS rS   rS   r   s     r,   rW   z!Point.__sub__.<locals>.<listcomp>&  s   € Ð)Ð)Ð)˜a˜�rÐ)Ð)Ð)r.   rS   rj   s     r,   Ú__sub__zPoint.__sub__#  s   € ð Ð)Ð) 5Ð)Ñ)Ô)Ñ)Ð)r.   c                 ó6  ‡‡— t          | dd¦  «        Š‰                     d‰¦  «        Š‰€t          d„ |D ¦   «         ¦  «        Št          ˆfd„|D ¦   «         ¦  «        rt	          |¦  «        S ‰‰d<   ‰                     dd¦  «        ‰d<   ˆfd„|D ¦   «         S )	z~Ensure that points have the same dimension.
        By default `on_morph='warn'` is passed to the
        `Point` constructor.Ú_ambient_dimensionNr!   c              3   ó$   K  — | ]}|j         V — Œd S r0   ©Úambient_dimension©r*   Úis     r,   r-   z-Point._normalize_dimension.<locals>.<genexpr>3  s%   è è € Ð:Ð:¨a�aÔ)Ð:Ð:Ð:Ð:Ð:Ð:r.   c              3   ó.   •K  — | ]}|j         ‰k    V — Œd S r0   r‡   )r*   rŠ   r!   s     €r,   r-   z-Point._normalize_dimension.<locals>.<genexpr>4  s+   øè è € Ð:Ð:¨aˆqÔ" cÒ)Ð:Ð:Ð:Ð:Ð:Ð:r.   r   r$   c                 ó*   •— g | ]}t          |fi ‰¤Ž‘ŒS rS   ©r   )r*   rŠ   rH   s     €r,   rW   z.Point._normalize_dimension.<locals>.<listcomp>8  s)   ø€ Ð3Ð3Ð3 q•�aÐ"Ð"˜6Ð"Ð"Ð3Ð3Ð3r.   )Úgetattrr8   Úmaxr@   Úlist)rF   ÚpointsrH   r!   s     `@r,   rX   zPoint._normalize_dimension(  s¸   øø€ õ �cÐ/°Ñ6Ô6ˆà�jŠj˜ Ñ$Ô$ˆàˆ;ÝÐ:Ð:°6Ð:Ñ:Ô:Ñ:Ô:ˆCÝÐ:Ð:Ð:Ð:°6Ð:Ñ:Ô:Ñ:Ô:ð 	 Ý˜‘<”<ÐØˆˆu‰Ø#ŸZšZ¨
°FÑ;Ô;ˆˆzÑØ3Ð3Ð3Ð3¨FÐ3Ñ3Ô3Ð3r.   c                  óú   ‡— t          | ¦  «        dk    rdS t          j        d„ | D ¦   «         Ž }|d         Šˆfd„|dd…         D ¦   «         }t          d„ |D ¦   «         ¦  «        }|                     d„ ¬	¦  «        S )
ag  The affine rank of a set of points is the dimension
        of the smallest affine space containing all the points.
        For example, if the points lie on a line (and are not all
        the same) their affine rank is 1.  If the points lie on a plane
        but not a line, their affine rank is 2.  By convention, the empty
        set has affine rank -1.r   éÿÿÿÿc                 ó,   — g | ]}t          |¦  «        ‘ŒS rS   r�   r‰   s     r,   rW   z%Point.affine_rank.<locals>.<listcomp>G  s   € Ð-EÐ-EÐ-E¸1­e°A©h¬hÐ-EÐ-EÐ-Er.   c                 ó   •— g | ]}|‰z
  ‘ŒS rS   rS   )r*   rŠ   rN   s     €r,   rW   z%Point.affine_rank.<locals>.<listcomp>I  s   ø€ Ð1Ð1Ð1 �!�f‘*Ð1Ð1Ð1r.   r   Nc                 ó   — g | ]	}|j         ‘Œ
S rS   r_   r‰   s     r,   rW   z%Point.affine_rank.<locals>.<listcomp>K  s   € Ð+Ð+Ð+˜q�A”FÐ+Ð+Ð+r.   c                 ój   — | j         r&t          |                      d¦  «        ¦  «        dk     n| j        S )Nr"   gê-�™—q=)r'   ÚabsÚnr(   )re   s    r,   ú<lambda>z#Point.affine_rank.<locals>.<lambda>M  s-   € Ø#$¤;Ð=�C�—’�A‘”‰KŒK˜%ÒÐ°A´Ið r.   )Ú
iszerofunc)r9   r   rX   r   Úrank)rG   r‘   ÚmrN   s      @r,   Úaffine_rankzPoint.affine_rank:  sŸ   ø€ õ ˆt‰9Œ9˜Š>ˆ>Ø�2õ Ô+Ð-EÐ-EÀÐ-EÑ-EÔ-EÐFˆØ˜”ˆØ1Ð1Ð1Ð1 f¨Q¨R¨R¤jÐ1Ñ1Ô1ˆåÐ+Ð+ FÐ+Ñ+Ô+Ñ,Ô,ˆà�vŠvð $>ð $>ˆvñ ?ô ?ð 	?r.   c                 ó>   — t          | dt          | ¦  «        ¦  «        S )z$Number of components this point has.r…   )rŽ   r9   rq   s    r,   rˆ   zPoint.ambient_dimensionP  s   € õ �tÐ1µ3°t±9´9Ñ=Ô=Ð=r.   c                 óÖ   — t          |¦  «        dk    rdS  | j        d„ |D ¦   «         Ž }|d         j        dk    rdS t          t	          |¦  «        ¦  «        }t          j        |Ž dk    S )añ  Return True if there exists a plane in which all the points
        lie.  A trivial True value is returned if `len(points) < 3` or
        all Points are 2-dimensional.

        Parameters
        ==========

        A set of points

        Raises
        ======

        ValueError : if less than 3 unique points are given

        Returns
        =======

        boolean

        Examples
        ========

        >>> from sympy import Point3D
        >>> p1 = Point3D(1, 2, 2)
        >>> p2 = Point3D(2, 7, 2)
        >>> p3 = Point3D(0, 0, 2)
        >>> p4 = Point3D(1, 1, 2)
        >>> Point3D.are_coplanar(p1, p2, p3, p4)
        True
        >>> p5 = Point3D(0, 1, 3)
        >>> Point3D.are_coplanar(p1, p2, p3, p5)
        False

        r   Tc                 ó,   — g | ]}t          |¦  «        ‘ŒS rS   r�   r‰   s     r,   rW   z&Point.are_coplanar.<locals>.<listcomp>|  s   € Ð+EÐ+EÐ+E¸­E°!©H¬HÐ+EÐ+EÐ+Er.   r   r"   )r9   rX   rˆ   r�   r   r   rž   )rF   r‘   s     r,   Úare_coplanarzPoint.are_coplanarU  sv   € õH ˆv‰;Œ;˜!ÒÐØ�4à)�Ô)Ð+EÐ+E¸fÐ+EÑ+EÔ+EÐFˆà�!Œ9Ô&¨!Ò+Ð+Ø�4Ý•d˜6‘l”lÑ#Ô#ˆÝÔ  &Ð)¨QÒ.Ð.r.   c           	      ó  — t          |t          ¦  «        sE	 t          || j        ¬¦  «        }n-# t          $ r  t	          dt          |¦  «        z  ¦  «        ‚w xY wt          |t          ¦  «        rYt                               | t          |¦  «        ¦  «        \  }}t          t          d„ t          ||¦  «        D ¦   «         Ž ¦  «        S t          |dd¦  «        }|€t	          dt          |¦  «        z  ¦  «        ‚ || ¦  «        S )az  The Euclidean distance between self and another GeometricEntity.

        Returns
        =======

        distance : number or symbolic expression.

        Raises
        ======

        TypeError : if other is not recognized as a GeometricEntity or is a
                    GeometricEntity for which distance is not defined.

        See Also
        ========

        sympy.geometry.line.Segment.length
        sympy.geometry.point.Point.taxicab_distance

        Examples
        ========

        >>> from sympy import Point, Line
        >>> p1, p2 = Point(1, 1), Point(4, 5)
        >>> l = Line((3, 1), (2, 2))
        >>> p1.distance(p2)
        5
        >>> p1.distance(l)
        sqrt(2)

        The computed distance may be symbolic, too:

        >>> from sympy.abc import x, y
        >>> p3 = Point(x, y)
        >>> p3.distance((0, 0))
        sqrt(x**2 + y**2)

        ©r!   z'not recognized as a GeometricEntity: %sc              3   ó,   K  — | ]\  }}||z
  d z  V — ŒdS ©r"   NrS   rU   s      r,   r-   z!Point.distance.<locals>.<genexpr>±  s.   è è € Ð?Ð?©T¨Q°˜q 1™u q™jÐ?Ð?Ð?Ð?Ð?Ð?r.   rL   Nz,distance between Point and %s is not defined)r1   r   r   rˆ   r:   ÚtyperX   r   r   rY   rŽ   )rM   rZ   r[   ÚprL   s        r,   rL   zPoint.distanceƒ  s  € õN ˜%¥Ñ0Ô0ð 	YðYÝ˜e¨Ô)?Ð@Ñ@Ô@��øÝð Yð Yð YÝÐ IÍDÐQVÉKÌKÑ WÑXÔXÐXðYøøøå�e�UÑ#Ô#ð 	BÝ×-Ò-¨dµE¸%±L´LÑAÔA‰DˆAˆqÝ�Ð?Ð?µS¸¸A±Y´YÐ?Ñ?Ô?Ð@ÑAÔAÐAÝ˜5 *¨dÑ3Ô3ˆØÐÝÐJÍTÐRWÉ[Ì[ÑXÑYÔYÐYØˆx˜‰~Œ~Ðs	   —. ®*Ac                 ó€   — t          |¦  «        st          |¦  «        }t          d„ t          | |¦  «        D ¦   «         Ž S )z.Return dot product of self with another Point.c              3   ó&   K  — | ]\  }}||z  V — Œd S r0   rS   rU   s      r,   r-   zPoint.dot.<locals>.<genexpr>»  s*   è è € Ð2Ð2™T˜Q �Q�q‘SÐ2Ð2Ð2Ð2Ð2Ð2r.   )r   r   r   rY   )rM   r¨   s     r,   Údotz	Point.dot·  s=   € å˜1‰~Œ~ð 	Ý�a‘”ˆAÝÐ2Ð2¥S¨¨q¡\¤\Ð2Ñ2Ô2Ð3Ð3r.   c                 ó¾   — t          |t          ¦  «        r t          | ¦  «        t          |¦  «        k    rdS t          d„ t	          | |¦  «        D ¦   «         ¦  «        S )z8Returns whether the coordinates of self and other agree.Fc              3   óF   K  — | ]\  }}|                      |¦  «        V — Œd S r0   )ÚequalsrU   s      r,   r-   zPoint.equals.<locals>.<genexpr>Â  s0   è è € Ð<Ð<¡4 1 a�1—8’8˜A‘;”;Ð<Ð<Ð<Ð<Ð<Ð<r.   )r1   r   r9   r@   rY   rj   s     r,   r®   zPoint.equals½  sX   € õ ˜%¥Ñ'Ô'ð 	­3¨t©9¬9½¸E¹
¼
Ò+BÐ+BØ�5ÝÐ<Ð<­3¨t°UÑ+;Ô+;Ð<Ñ<Ô<Ñ<Ô<Ð<r.   é   c                 ód   ‡‡— t          |¦  «        Šˆˆfd„| j        D ¦   «         }t          |ddiŽS )aF  Evaluate the coordinates of the point.

        This method will, where possible, create and return a new Point
        where the coordinates are evaluated as floating point numbers to
        the precision indicated (default=15).

        Parameters
        ==========

        prec : int

        Returns
        =======

        point : Point

        Examples
        ========

        >>> from sympy import Point, Rational
        >>> p1 = Point(Rational(1, 2), Rational(3, 2))
        >>> p1
        Point2D(1/2, 3/2)
        >>> p1.evalf()
        Point2D(0.5, 1.5)

        c                 ó.   •— g | ]} |j         dd ‰i‰¤Ž‘ŒS )r™   rS   )Úevalf)r*   re   ÚdpsÚoptionss     €€r,   rW   z%Point._eval_evalf.<locals>.<listcomp>á  s0   ø€ Ð?Ð?Ð?°�'�!”'Ð+Ð+˜CÐ+ 7Ð+Ð+Ð?Ð?Ð?r.   r   F)r   rG   r   )rM   Úprecr´   rI   r³   s     ` @r,   Ú_eval_evalfzPoint._eval_evalfÄ  sD   øø€ õ8 ˜$ÑÔˆØ?Ð?Ð?Ð?Ð?°T´YÐ?Ñ?Ô?ˆÝ�fÐ- uÐ-Ð-Ð-r.   c                 ó  — t          |t          ¦  «        st          |¦  «        }t          |t          ¦  «        r8| |k    r| gS t                               | |¦  «        \  }}|| k    r	||k    r| gS g S |                     | ¦  «        S )a|  The intersection between this point and another GeometryEntity.

        Parameters
        ==========

        other : GeometryEntity or sequence of coordinates

        Returns
        =======

        intersection : list of Points

        Notes
        =====

        The return value will either be an empty list if there is no
        intersection, otherwise it will contain this point.

        Examples
        ========

        >>> from sympy import Point
        >>> p1, p2, p3 = Point(0, 0), Point(1, 1), Point(0, 0)
        >>> p1.intersection(p2)
        []
        >>> p1.intersection(p3)
        [Point2D(0, 0)]

        )r1   r   r   rX   Úintersection)rM   rZ   Úp1Úp2s       r,   r¸   zPoint.intersectionä  s�   € õ< ˜%¥Ñ0Ô0ð 	!Ý˜%‘L”LˆEÝ�e�UÑ#Ô#ð 	Ø�uŠ}ˆ}Ø�v�Ý×/Ò/°°eÑ<Ô<‰FˆB�Ø�TŠzˆz˜b Bšh˜hØ�v�ØˆIØ×!Ò! $Ñ'Ô'Ð'r.   c                 óš   — | f|z   }t          j        d„ |D ¦   «         Ž }t          t          |¦  «        ¦  «        }t          j        |Ž dk    S )aÛ  Returns `True` if there exists a line
        that contains `self` and `points`.  Returns `False` otherwise.
        A trivially True value is returned if no points are given.

        Parameters
        ==========

        args : sequence of Points

        Returns
        =======

        is_collinear : boolean

        See Also
        ========

        sympy.geometry.line.Line

        Examples
        ========

        >>> from sympy import Point
        >>> from sympy.abc import x
        >>> p1, p2 = Point(0, 0), Point(1, 1)
        >>> p3, p4, p5 = Point(2, 2), Point(x, x), Point(1, 2)
        >>> Point.is_collinear(p1, p2, p3, p4)
        True
        >>> Point.is_collinear(p1, p2, p3, p5)
        False

        c                 ó,   — g | ]}t          |¦  «        ‘ŒS rS   r�   r‰   s     r,   rW   z&Point.is_collinear.<locals>.<listcomp>/  ó   € Ð-GÐ-GÐ-G¸1­e°A©h¬hÐ-GÐ-GÐ-Gr.   r   )r   rX   r�   r   rž   )rM   rG   r‘   s      r,   Úis_collinearzPoint.is_collinear  sR   € ðB �˜4‘ˆÝÔ+Ð-GÐ-GÀÐ-GÑ-GÔ-GÐHˆÝ•d˜6‘l”lÑ#Ô#ˆÝÔ  &Ð)¨QÒ.Ð.r.   c                 óV  ‡— | f|z   }t          j        d„ |D ¦   «         Ž }t          t          |¦  «        ¦  «        }t          j        |Ž dk    sdS |d         Šˆfd„|D ¦   «         }t          d„ |D ¦   «         ¦  «        }|                     ¦   «         \  }}t          ‰¦  «        |vrdS dS )a  Do `self` and the given sequence of points lie in a circle?

        Returns True if the set of points are concyclic and
        False otherwise. A trivial value of True is returned
        if there are fewer than 2 other points.

        Parameters
        ==========

        args : sequence of Points

        Returns
        =======

        is_concyclic : boolean


        Examples
        ========

        >>> from sympy import Point

        Define 4 points that are on the unit circle:

        >>> p1, p2, p3, p4 = Point(1, 0), (0, 1), (-1, 0), (0, -1)

        >>> p1.is_concyclic() == p1.is_concyclic(p2, p3, p4) == True
        True

        Define a point not on that circle:

        >>> p = Point(1, 1)

        >>> p.is_concyclic(p1, p2, p3)
        False

        c                 ó,   — g | ]}t          |¦  «        ‘ŒS rS   r�   r‰   s     r,   rW   z&Point.is_concyclic.<locals>.<listcomp>Z  r½   r.   r"   Fr   c                 ó   •— g | ]}|‰z
  ‘ŒS rS   rS   )r*   r¨   rN   s     €r,   rW   z&Point.is_concyclic.<locals>.<listcomp>_  s   ø€ Ð-Ð-Ð- �!�f‘*Ð-Ð-Ð-r.   c                 óZ   — g | ](}t          |¦  «        |                     |¦  «        gz   ‘Œ)S rS   )r�   r«   r‰   s     r,   rW   z&Point.is_concyclic.<locals>.<listcomp>e  s/   € Ð;Ð;Ð;¨q•d˜1‘g”g §¢ q¡¤ 
Ñ*Ð;Ð;Ð;r.   T)r   rX   r�   r   rž   r   Úrrefr9   )rM   rG   r‘   ÚmatrÃ   ÚpivotsrN   s         @r,   Úis_concycliczPoint.is_concyclic3  sÄ   ø€ ðL �˜4‘ˆÝÔ+Ð-GÐ-GÀÐ-GÑ-GÔ-GÐHˆÝ•d˜6‘l”lÑ#Ô#ˆÝÔ  &Ð)¨QÒ.Ð.Ø�5Ø˜”ˆØ-Ð-Ð-Ð- fÐ-Ñ-Ô-ˆõ Ð;Ð;°FÐ;Ñ;Ô;Ñ<Ô<ˆØ—x’x‘z”z‰ˆˆfÝˆv‰;Œ;˜fÐ$Ð$Ø�4Øˆur.   c                 ó   — | j         }|€dS | S )zrTrue if any coordinate is nonzero, False if every coordinate is zero,
        and None if it cannot be determined.N)r(   )rM   r(   s     r,   Ú
is_nonzerozPoint.is_nonzerok  s   € ð ”,ˆØˆ?Ø�4Øˆ{Ðr.   c                 ó‚  — t                                | t          |¦  «        ¦  «        \  }}|j        dk    rW|j        |j        c\  }}\  }}||z  ||z  z
                       d¦  «        }|€"t          t          d|›d|›�¦  «        ¦  «        ‚t          |j        |j        g¦  «        }	|	                     ¦   «         dk     S )z{Returns whether each coordinate of `self` is a scalar
        multiple of the corresponding coordinate in point p.
        r"   r   NzCannot determine if z- is a scalar multiple of
                    )	r   rX   rˆ   rG   r®   r   r   r   rœ   )
rM   r¨   r[   r\   Úx1Úy1Úx2Úy2Úrvr�   s
             r,   Úis_scalar_multiplezPoint.is_scalar_multiplet  sÇ   € õ ×)Ò)¨$µ°a±´Ñ9Ô9‰ˆˆ1àÔ !Ò#Ð#Ø!"¤¨¬Ð‰HˆR�‘h�r˜2Ø�R‘%˜"˜R™%‘-×'Ò'¨Ñ*Ô*ˆBØˆzÝ!¥* *à˜Q˜Q  ð#ñ#$ô #$ñ %ô %ð %õ �A”F˜AœFÐ#Ñ$Ô$ˆØ�vŠv‰xŒx˜!Š|Ðr.   c                 ó€   — d„ | j         D ¦   «         }t          |¦  «        rdS t          d„ |D ¦   «         ¦  «        rdS dS )zsTrue if every coordinate is zero, False if any coordinate is not zero,
        and None if it cannot be determined.c                 ó   — g | ]	}|j         ‘Œ
S rS   )rÈ   r   s     r,   rW   z!Point.is_zero.<locals>.<listcomp>‹  s   € Ð3Ð3Ð3 A�1”<Ð3Ð3Ð3r.   Fc              3   ó   K  — | ]}|d u V — Œ	d S r0   rS   r   s     r,   r-   z Point.is_zero.<locals>.<genexpr>Ž  s&   è è € Ð*Ð*˜Qˆq�DˆyÐ*Ð*Ð*Ð*Ð*Ð*r.   NT)rG   r?   )rM   Únonzeros     r,   r(   zPoint.is_zero‡  sU   € ð 4Ð3¨¬Ð3Ñ3Ô3ˆÝˆw‰<Œ<ð 	Ø�5ÝÐ*Ð* 'Ð*Ñ*Ô*Ñ*Ô*ð 	Ø�4Øˆtr.   c                 ó   — t           j        S )zÚ
        Treating a Point as a Line, this returns 0 for the length of a Point.

        Examples
        ========

        >>> from sympy import Point
        >>> p = Point(0, 1)
        >>> p.length
        0
        )r   r<   rq   s    r,   ÚlengthzPoint.length’  s   € õ Œvˆr.   c                 ó¦   — t                                | t          |¦  «        ¦  «        \  }}t          d„ t          ||¦  «        D ¦   «         ¦  «        S )aŸ  The midpoint between self and point p.

        Parameters
        ==========

        p : Point

        Returns
        =======

        midpoint : Point

        See Also
        ========

        sympy.geometry.line.Segment.midpoint

        Examples
        ========

        >>> from sympy import Point
        >>> p1, p2 = Point(1, 1), Point(13, 5)
        >>> p1.midpoint(p2)
        Point2D(7, 3)

        c                 óR   — g | ]$\  }}t          ||z   t          j        z  ¦  «        ‘Œ%S rS   )r   r   ÚHalfrU   s      r,   rW   z"Point.midpoint.<locals>.<listcomp>½  s.   € ÐEÐEÐE±4°1°a•h  A¡¥q¤v™~Ñ.Ô.ÐEÐEÐEr.   )r   rX   rY   ©rM   r¨   r[   s      r,   ÚmidpointzPoint.midpoint¡  sH   € õ6 ×)Ò)¨$µ°a±´Ñ9Ô9‰ˆˆ1ÝÐEÐE½3¸qÀ!¹9¼9ÐEÑEÔEÑFÔFÐFr.   c                 óF   — t          dgt          | ¦  «        z  d¬¦  «        S )zOA point of all zeros of the same ambient dimension
        as the current pointr   FrQ   )r   r9   rq   s    r,   rN   zPoint.origin¿  s#   € õ �a�S�˜T™œ‘]¨UÐ3Ñ3Ô3Ð3r.   c                 óþ   — | j         }| d         j        rt          dg|dz
  dgz  z   ¦  «        S | d         j        rt          ddg|dz
  dgz  z   ¦  «        S t          | d          | d         g|dz
  dgz  z   ¦  «        S )au  Returns a non-zero point that is orthogonal to the
        line containing `self` and the origin.

        Examples
        ========

        >>> from sympy import Line, Point
        >>> a = Point(1, 2, 3)
        >>> a.orthogonal_direction
        Point3D(-2, 1, 0)
        >>> b = _
        >>> Line(b, b.origin).is_perpendicular(Line(a, a.origin))
        True
        r   r   r"   )rˆ   r(   r   )rM   r!   s     r,   Úorthogonal_directionzPoint.orthogonal_directionÅ  s–   € ð  Ô$ˆà�Œ7Œ?ð 	.Ý˜!˜  a¡¨!¨™}Ñ,Ñ-Ô-Ð-Ø�Œ7Œ?ð 	0Ý˜!˜A˜ #¨¡'¨A¨3¡Ñ.Ñ/Ô/Ð/õ �t˜A”w�h  Q¤Ð(¨C°!©G°a°S©=Ñ8Ñ9Ô9Ð9r.   c                 óú   — t                                t          | ¦  «        t          |¦  «        ¦  «        \  } }|j        rt          d¦  «        ‚||                      |¦  «        |                     |¦  «        z  z  S )a‚  Project the point `a` onto the line between the origin
        and point `b` along the normal direction.

        Parameters
        ==========

        a : Point
        b : Point

        Returns
        =======

        p : Point

        See Also
        ========

        sympy.geometry.line.LinearEntity.projection

        Examples
        ========

        >>> from sympy import Line, Point
        >>> a = Point(1, 2)
        >>> b = Point(2, 5)
        >>> z = a.origin
        >>> p = Point.project(a, b)
        >>> Line(p, a).is_perpendicular(Line(p, b))
        True
        >>> Point.is_collinear(z, p, b)
        True
        ú"Cannot project to the zero vector.)r   rX   r(   r=   r«   )r+   rV   s     r,   ÚprojectzPoint.projectß  sh   € õD ×)Ò)­%°©(¬(µE¸!±H´HÑ=Ô=‰ˆˆ1ØŒ9ð 	CÝÐAÑBÔBÐBØ�!—%’%˜‘(”(˜QŸUšU 1™XœXÑ%Ñ&Ð&r.   c                 óš   — t                                | t          |¦  «        ¦  «        \  }}t          d„ t          ||¦  «        D ¦   «         Ž S )a2  The Taxicab Distance from self to point p.

        Returns the sum of the horizontal and vertical distances to point p.

        Parameters
        ==========

        p : Point

        Returns
        =======

        taxicab_distance : The sum of the horizontal
        and vertical distances to point p.

        See Also
        ========

        sympy.geometry.point.Point.distance

        Examples
        ========

        >>> from sympy import Point
        >>> p1, p2 = Point(1, 1), Point(4, 5)
        >>> p1.taxicab_distance(p2)
        7

        c              3   ó@   K  — | ]\  }}t          ||z
  ¦  «        V — Œd S r0   ©r˜   rU   s      r,   r-   z)Point.taxicab_distance.<locals>.<genexpr>%  s0   è è € Ð6Ð6¡D A q•S˜˜Q™‘Z”ZÐ6Ð6Ð6Ð6Ð6Ð6r.   )r   rX   r   rY   rÙ   s      r,   Útaxicab_distancezPoint.taxicab_distance  sE   € õ< ×)Ò)¨$µ°a±´Ñ9Ô9‰ˆˆ1ÝÐ6Ð6­C°°1©I¬IÐ6Ñ6Ô6Ð7Ð7r.   c                 óÔ   — t                                | t          |¦  «        ¦  «        \  }}| j        r|j        rt          d¦  «        ‚t	          d„ t          ||¦  «        D ¦   «         Ž S )a=  The Canberra Distance from self to point p.

        Returns the weighted sum of horizontal and vertical distances to
        point p.

        Parameters
        ==========

        p : Point

        Returns
        =======

        canberra_distance : The weighted sum of horizontal and vertical
        distances to point p. The weight used is the sum of absolute values
        of the coordinates.

        Examples
        ========

        >>> from sympy import Point
        >>> p1, p2 = Point(1, 1), Point(3, 3)
        >>> p1.canberra_distance(p2)
        1
        >>> p1, p2 = Point(0, 0), Point(3, 3)
        >>> p1.canberra_distance(p2)
        2

        Raises
        ======

        ValueError when both vectors are zero.

        See Also
        ========

        sympy.geometry.point.Point.distance

        rß   c              3   ó€   K  — | ]9\  }}t          ||z
  ¦  «        t          |¦  «        t          |¦  «        z   z  V — Œ:d S r0   rã   rU   s      r,   r-   z*Point.canberra_distance.<locals>.<genexpr>S  sE   è è € ÐJÐJ¹¸¸1•c˜!˜a™%‘j”j¥# a¡&¤&­3¨q©6¬6¡/Ñ2ÐJÐJÐJÐJÐJÐJr.   )r   rX   r(   r=   r   rY   rÙ   s      r,   Úcanberra_distancezPoint.canberra_distance'  sj   € õR ×)Ò)¨$µ°a±´Ñ9Ô9‰ˆˆ1ØŒ<ð 	C˜AœIð 	CÝÐAÑBÔBÐBÝÐJÐJÅÀAÀqÁ	Ä	ÐJÑJÔJÐKÐKr.   c                 ó&   — | t          | ¦  «        z  S )zdReturn the Point that is in the same direction as `self`
        and a distance of 1 from the originrã   rq   s    r,   Úunitz
Point.unitU  s   € ð •c˜$‘i”iÑÐr.   N)r¯   ),Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úis_PointrE   rO   r]   rb   rh   rk   rn   rr   rt   rv   rz   r|   r€   rƒ   ÚclassmethodrX   Ústaticmethodrž   Úpropertyrˆ   r¢   rL   r«   r®   r¶   r¸   r¾   rÆ   rÈ   rÏ   r(   rÕ   rÚ   rN   rÝ   rà   rä   rç   ré   rS   r.   r,   r   r   *   sß  € € € € € ð>ð >ð@ €HðF4ð F4ð F4ðP,ð ,ð ,ð
%-ð %-ð %-ðN!ð !ð !ð-ð -ð -ð'ð 'ð 'ð
ð ð ðð ð ð$ð $ð $ðð ð ð-ð -ð -ð>$ð $ð $ð-ð -ð -ð
*ð *ð *ð
 ð4ð 4ñ „[ð4ð" ð?ð ?ñ „\ð?ð* ð>ð >ñ „Xð>ð ð+/ð +/ñ „[ð+/ðZ2ð 2ð 2ðh4ð 4ð 4ð=ð =ð =ð.ð .ð .ð .ð@'(ð '(ð '(ðR$/ð $/ð $/ðL6ð 6ð 6ðp ðð ñ „Xððð ð ð& ðð ñ „Xðð ðð ñ „XððGð Gð Gð< ð4ð 4ñ „Xð4ð
 ð:ð :ñ „Xð:ð2 ð$'ð $'ñ „\ð$'ðL8ð 8ð 8ðB,Lð ,Lð ,Lð\ ð ð  ñ „Xð ð  ð  r.   r   c                   óž   — e Zd ZdZdZddœd„Zd„ Zed„ ¦   «         Zdd	„Z	dd„Z
d„ Zdd„Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         ZdS )rC   a±  A point in a 2-dimensional Euclidean space.

    Parameters
    ==========

    coords
        A sequence of 2 coordinate values.

    Attributes
    ==========

    x
    y
    length

    Raises
    ======

    TypeError
        When trying to add or subtract points with different dimensions.
        When trying to create a point with more than two dimensions.
        When `intersection` is called with object other than a Point.

    See Also
    ========

    sympy.geometry.line.Segment : Connects two Points

    Examples
    ========

    >>> from sympy import Point2D
    >>> from sympy.abc import x
    >>> Point2D(1, 2)
    Point2D(1, 2)
    >>> Point2D([1, 2])
    Point2D(1, 2)
    >>> Point2D(0, x)
    Point2D(0, x)

    Floats are automatically converted to Rational unless the
    evaluate flag is False:

    >>> Point2D(0.5, 0.25)
    Point2D(1/2, 1/4)
    >>> Point2D(0.5, 0.25, evaluate=False)
    Point2D(0.5, 0.25)

    r"   F©r6   c                óL   — |sd|d<   t          |i |¤Ž}t          j        | g|¢R Ž S )Nr"   r!   ©r   r   rE   ©rF   r6   rG   rH   s       r,   rE   zPoint2D.__new__‘  ó>   € Øð 	*ØˆF�5‰MÝ˜$Ð) &Ð)Ð)ˆDÝÔ% cÐ1¨DÐ1Ð1Ð1Ð1r.   c                 ó   — || k    S r0   rS   r`   s     r,   rb   zPoint2D.__contains__—  ó   € Ø�tŠ|Ðr.   c                 ó6   — | j         | j        | j         | j        fS )zwReturn a tuple (xmin, ymin, xmax, ymax) representing the bounding
        rectangle for the geometric figure.

        )re   Úyrq   s    r,   ÚboundszPoint2D.boundsš  s   € ð ”˜œ ¤¨¬Ð/Ð/r.   Nc                 óÜ   — t          |¦  «        }t          |¦  «        }| }|�t          |d¬¦  «        }||z  }|j        \  }}t          ||z  ||z  z
  ||z  ||z  z   ¦  «        }|�||z  }|S )a[  Rotate ``angle`` radians counterclockwise about Point ``pt``.

        See Also
        ========

        translate, scale

        Examples
        ========

        >>> from sympy import Point2D, pi
        >>> t = Point2D(1, 0)
        >>> t.rotate(pi/2)
        Point2D(0, 1)
        >>> t.rotate(pi/2, (2, 0))
        Point2D(2, -1)

        Nr"   r¤   )r   r   r   rG   )rM   ÚangleÚptÚcr[   rÎ   re   rû   s           r,   ÚrotatezPoint2D.rotate£  s„   € õ& �‰JŒJˆÝ�‰JŒJˆàˆØˆ>Ý�r˜qÐ!Ñ!Ô!ˆBØ�"‰HˆBØŒw‰ˆˆ1Ý�1�Q‘3˜˜1™‘9˜a ™c A a¡C™iÑ(Ô(ˆØˆ>Ø�"‰HˆBØˆ	r.   r   c                 óÊ   — |rBt          |d¬¦  «        }  | j        | j        Ž                      ||¦  «        j        |j        Ž S t          | j        |z  | j        |z  ¦  «        S )aõ  Scale the coordinates of the Point by multiplying by
        ``x`` and ``y`` after subtracting ``pt`` -- default is (0, 0) --
        and then adding ``pt`` back again (i.e. ``pt`` is the point of
        reference for the scaling).

        See Also
        ========

        rotate, translate

        Examples
        ========

        >>> from sympy import Point2D
        >>> t = Point2D(1, 1)
        >>> t.scale(2)
        Point2D(2, 1)
        >>> t.scale(2, 2)
        Point2D(2, 2)

        r"   r¤   )r   Ú	translaterG   Úscalere   rû   )rM   re   rû   rÿ   s       r,   r  zPoint2D.scaleÃ  sj   € ð, ð 	OÝ�r˜qÐ!Ñ!Ô!ˆBØD�>�4”> R C¤:Ð.×4Ò4°Q¸Ñ:Ô:ÔDÀbÄgÐNÐNÝ�T”V˜A‘X˜tœv a™xÑ(Ô(Ð(r.   c           	      óÔ   — |j         r|j        dk    st          d¦  «        ‚| j        \  }}t	          t          dd||dg¦  «        |z                       ¦   «         d         dd…         Ž S )a  Return the point after applying the transformation described
        by the 3x3 Matrix, ``matrix``.

        See Also
        ========
        sympy.geometry.point.Point2D.rotate
        sympy.geometry.point.Point2D.scale
        sympy.geometry.point.Point2D.translate
        )r7   r7   zmatrix must be a 3x3 matrixr   r7   r   Nr"   )Ú	is_MatrixÚshaper=   rG   r   r   Útolist)rM   Úmatrixre   rû   s       r,   Ú	transformzPoint2D.transformÞ  sq   € ð Ô ð 	< V¤\°VÒ%;Ð%;ÝÐ:Ñ;Ô;Ð;ØŒy‰ˆˆ1Ý•v˜a  Q¨¨1 IÑ.Ô.¨vÑ5×=Ò=Ñ?Ô?ÀÔBÀ2ÀAÀ2ÔFÐGÐGr.   r   c                 óB   — t          | j        |z   | j        |z   ¦  «        S )a¤  Shift the Point by adding x and y to the coordinates of the Point.

        See Also
        ========

        sympy.geometry.point.Point2D.rotate, scale

        Examples
        ========

        >>> from sympy import Point2D
        >>> t = Point2D(0, 1)
        >>> t.translate(2)
        Point2D(2, 1)
        >>> t.translate(2, 2)
        Point2D(2, 3)
        >>> t + Point2D(2, 2)
        Point2D(2, 3)

        )r   re   rû   )rM   re   rû   s      r,   r  zPoint2D.translateí  s    € õ* �T”V˜a‘Z ¤¨!¡Ñ,Ô,Ð,r.   c                 ó   — | j         S )zÌ
        Returns the two coordinates of the Point.

        Examples
        ========

        >>> from sympy import Point2D
        >>> p = Point2D(0, 1)
        >>> p.coordinates
        (0, 1)
        r_   rq   s    r,   ÚcoordinateszPoint2D.coordinates  ó   € ð ŒyÐr.   c                 ó   — | j         d         S )zº
        Returns the X coordinate of the Point.

        Examples
        ========

        >>> from sympy import Point2D
        >>> p = Point2D(0, 1)
        >>> p.x
        0
        r   r_   rq   s    r,   re   z	Point2D.x  ó   € ð Œy˜Œ|Ðr.   c                 ó   — | j         d         S )zº
        Returns the Y coordinate of the Point.

        Examples
        ========

        >>> from sympy import Point2D
        >>> p = Point2D(0, 1)
        >>> p.y
        1
        r   r_   rq   s    r,   rû   z	Point2D.y"  r  r.   r0   )r   r   N)r   r   )rê   rë   rì   rí   r…   rE   rb   rñ   rü   r  r  r
  r  r  re   rû   rS   r.   r,   rC   rC   \  s  € € € € € ð0ð 0ðd Ðà%*ð 2ð 2ð 2ð 2ð 2ðð ð ð ð0ð 0ñ „Xð0ðð ð ð ð@)ð )ð )ð )ð6Hð Hð Hð-ð -ð -ð -ð. ðð ñ „Xðð ðð ñ „Xðð ðð ñ „Xðð ð r.   rC   c                   ó¾   — e Zd ZdZdZddœd„Zd„ Zed„ ¦   «         Zd„ Z	d	„ Z
d
„ Zdd„Zd„ Zdd„Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         ZdS )rD   a>  A point in a 3-dimensional Euclidean space.

    Parameters
    ==========

    coords
        A sequence of 3 coordinate values.

    Attributes
    ==========

    x
    y
    z
    length

    Raises
    ======

    TypeError
        When trying to add or subtract points with different dimensions.
        When `intersection` is called with object other than a Point.

    Examples
    ========

    >>> from sympy import Point3D
    >>> from sympy.abc import x
    >>> Point3D(1, 2, 3)
    Point3D(1, 2, 3)
    >>> Point3D([1, 2, 3])
    Point3D(1, 2, 3)
    >>> Point3D(0, x, 3)
    Point3D(0, x, 3)

    Floats are automatically converted to Rational unless the
    evaluate flag is False:

    >>> Point3D(0.5, 0.25, 2)
    Point3D(1/2, 1/4, 2)
    >>> Point3D(0.5, 0.25, 3, evaluate=False)
    Point3D(0.5, 0.25, 3)

    r7   Fró   c                óL   — |sd|d<   t          |i |¤Ž}t          j        | g|¢R Ž S )Nr7   r!   rõ   rö   s       r,   rE   zPoint3D.__new__a  r÷   r.   c                 ó   — || k    S r0   rS   r`   s     r,   rb   zPoint3D.__contains__g  rù   r.   c                  ó   — t          j        | Ž S )aû  Is a sequence of points collinear?

        Test whether or not a set of points are collinear. Returns True if
        the set of points are collinear, or False otherwise.

        Parameters
        ==========

        points : sequence of Point

        Returns
        =======

        are_collinear : boolean

        See Also
        ========

        sympy.geometry.line.Line3D

        Examples
        ========

        >>> from sympy import Point3D
        >>> from sympy.abc import x
        >>> p1, p2 = Point3D(0, 0, 0), Point3D(1, 1, 1)
        >>> p3, p4, p5 = Point3D(2, 2, 2), Point3D(x, x, x), Point3D(1, 2, 6)
        >>> Point3D.are_collinear(p1, p2, p3, p4)
        True
        >>> Point3D.are_collinear(p1, p2, p3, p5)
        False
        )r   r¾   )r‘   s    r,   Úare_collinearzPoint3D.are_collinearj  s   € õD Ô! 6Ð*Ð*r.   c                 óÖ   — |                       |¦  «        }t          t          d„ |D ¦   «         Ž ¦  «        }|j        | j        z
  |z  |j        | j        z
  |z  |j        | j        z
  |z  gS )ap  
        Gives the direction cosine between 2 points

        Parameters
        ==========

        p : Point3D

        Returns
        =======

        list

        Examples
        ========

        >>> from sympy import Point3D
        >>> p1 = Point3D(1, 2, 3)
        >>> p1.direction_cosine(Point3D(2, 3, 5))
        [sqrt(6)/6, sqrt(6)/6, sqrt(6)/3]
        c              3   ó    K  — | ]	}|d z  V — Œ
dS r¦   rS   r‰   s     r,   r-   z+Point3D.direction_cosine.<locals>.<genexpr>¥  s&   è è € Ð'Ð' �q˜!‘tÐ'Ð'Ð'Ð'Ð'Ð'r.   )Údirection_ratior   r   re   rû   Úz)rM   Úpointr+   rV   s       r,   Údirection_cosinezPoint3D.direction_cosineŽ  st   € ð, × Ò  Ñ'Ô'ˆÝ•Ð'Ð' QÐ'Ñ'Ô'Ð(Ñ)Ô)ˆØ”˜4œ6Ñ! QÑ&¨¬°$´&Ñ(8¸AÑ'=Ø”˜4œ6Ñ! QÑ&ð(ð 	(r.   c                 óZ   — |j         | j         z
  |j        | j        z
  |j        | j        z
  gS )aV  
        Gives the direction ratio between 2 points

        Parameters
        ==========

        p : Point3D

        Returns
        =======

        list

        Examples
        ========

        >>> from sympy import Point3D
        >>> p1 = Point3D(1, 2, 3)
        >>> p1.direction_ratio(Point3D(2, 3, 5))
        [1, 1, 2]
        )re   rû   r  )rM   r  s     r,   r  zPoint3D.direction_ratio©  s,   € ð, ”˜4œ6Ñ! E¤G¨d¬fÑ$4°u´wÀÄÑ7GÐIÐIr.   c                 ó¸   — t          |t          ¦  «        st          |d¬¦  «        }t          |t          ¦  «        r| |k    r| gS g S |                     | ¦  «        S )a�  The intersection between this point and another GeometryEntity.

        Parameters
        ==========

        other : GeometryEntity or sequence of coordinates

        Returns
        =======

        intersection : list of Points

        Notes
        =====

        The return value will either be an empty list if there is no
        intersection, otherwise it will contain this point.

        Examples
        ========

        >>> from sympy import Point3D
        >>> p1, p2, p3 = Point3D(0, 0, 0), Point3D(1, 1, 1), Point3D(0, 0, 0)
        >>> p1.intersection(p2)
        []
        >>> p1.intersection(p3)
        [Point3D(0, 0, 0)]

        r7   r¤   )r1   r   r   rD   r¸   rj   s     r,   r¸   zPoint3D.intersectionÁ  sc   € õ< ˜%¥Ñ0Ô0ð 	(Ý˜% QÐ'Ñ'Ô'ˆEÝ�e�WÑ%Ô%ð 	Ø�uŠ}ˆ}Ø�v�ØˆIØ×!Ò! $Ñ'Ô'Ð'r.   r   Nc                 óÚ   — |rAt          |¦  «        }  | j        | j        Ž                      |||¦  «        j        |j        Ž S t          | j        |z  | j        |z  | j        |z  ¦  «        S )aö  Scale the coordinates of the Point by multiplying by
        ``x`` and ``y`` after subtracting ``pt`` -- default is (0, 0) --
        and then adding ``pt`` back again (i.e. ``pt`` is the point of
        reference for the scaling).

        See Also
        ========

        translate

        Examples
        ========

        >>> from sympy import Point3D
        >>> t = Point3D(1, 1, 1)
        >>> t.scale(2)
        Point3D(2, 1, 1)
        >>> t.scale(2, 2)
        Point3D(2, 2, 1)

        )rD   r  rG   r  re   rû   r  )rM   re   rû   r  rÿ   s        r,   r  zPoint3D.scaleç  sm   € ð, ð 	RÝ˜‘”ˆBØG�>�4”> R C¤:Ð.×4Ò4°Q¸¸1Ñ=Ô=ÔGÈÌÐQÐQÝ�t”v˜a‘x ¤¨¡¨4¬6°!©8Ñ4Ô4Ð4r.   c           
      óö   — |j         r|j        dk    st          d¦  «        ‚| j        \  }}}t	          |¦  «        }t          t          dd|||dg¦  «        |z                       ¦   «         d         dd…         Ž S )zéReturn the point after applying the transformation described
        by the 4x4 Matrix, ``matrix``.

        See Also
        ========
        sympy.geometry.point.Point3D.scale
        sympy.geometry.point.Point3D.translate
        )é   r!  zmatrix must be a 4x4 matrixr   r!  r   Nr7   )r  r  r=   rG   r   rD   r   r  )rM   r	  re   rû   r  r�   s         r,   r
  zPoint3D.transform  s‚   € ð Ô ð 	< V¤\°VÒ%;Ð%;ÝÐ:Ñ;Ô;Ð;Ø”)‰ˆˆ1ˆaÝ�fÑÔˆÝ�  1 q¨!¨Q° lÑ3Ô3°AÑ5×=Ò=Ñ?Ô?ÀÔBÀ2ÀAÀ2ÔFÐGÐGr.   r   c                 óT   — t          | j        |z   | j        |z   | j        |z   ¦  «        S )aŽ  Shift the Point by adding x and y to the coordinates of the Point.

        See Also
        ========

        scale

        Examples
        ========

        >>> from sympy import Point3D
        >>> t = Point3D(0, 1, 1)
        >>> t.translate(2)
        Point3D(2, 1, 1)
        >>> t.translate(2, 2)
        Point3D(2, 3, 1)
        >>> t + Point3D(2, 2, 2)
        Point3D(2, 3, 3)

        )rD   re   rû   r  )rM   re   rû   r  s       r,   r  zPoint3D.translate  s(   € õ* �t”v ‘z 4¤6¨A¡:¨t¬v¸©zÑ:Ô:Ð:r.   c                 ó   — | j         S )zÔ
        Returns the three coordinates of the Point.

        Examples
        ========

        >>> from sympy import Point3D
        >>> p = Point3D(0, 1, 2)
        >>> p.coordinates
        (0, 1, 2)
        r_   rq   s    r,   r  zPoint3D.coordinates(  r  r.   c                 ó   — | j         d         S )z½
        Returns the X coordinate of the Point.

        Examples
        ========

        >>> from sympy import Point3D
        >>> p = Point3D(0, 1, 3)
        >>> p.x
        0
        r   r_   rq   s    r,   re   z	Point3D.x7  r  r.   c                 ó   — | j         d         S )z½
        Returns the Y coordinate of the Point.

        Examples
        ========

        >>> from sympy import Point3D
        >>> p = Point3D(0, 1, 2)
        >>> p.y
        1
        r   r_   rq   s    r,   rû   z	Point3D.yF  r  r.   c                 ó   — | j         d         S )z½
        Returns the Z coordinate of the Point.

        Examples
        ========

        >>> from sympy import Point3D
        >>> p = Point3D(0, 1, 1)
        >>> p.z
        1
        r"   r_   rq   s    r,   r  z	Point3D.zU  r  r.   )r   r   r   N)r   r   r   )rê   rë   rì   rí   r…   rE   rb   rð   r  r  r  r¸   r  r
  r  rñ   r  re   rû   r  rS   r.   r,   rD   rD   1  sE  € € € € € ð+ð +ðZ Ðà%*ð 2ð 2ð 2ð 2ð 2ðð ð ð ð!+ð !+ñ „\ð!+ðF(ð (ð (ð6Jð Jð Jð0$(ð $(ð $(ðL5ð 5ð 5ð 5ð6Hð Hð Hð;ð ;ð ;ð ;ð. ðð ñ „Xðð ðð ñ „Xðð ðð ñ „Xðð ðð ñ „Xðð ð r.   rD   ),rí   r>   Ú
sympy.corer   r   r   Úsympy.core.addr   Úsympy.core.containersr   Úsympy.core.numbersr   Úsympy.core.parametersr	   Úsympy.simplify.simplifyr
   r   Úsympy.geometry.exceptionsr   Ú(sympy.functions.elementary.miscellaneousr   Ú$sympy.functions.elementary.complexesr   Ú(sympy.functions.elementary.trigonometricr   r   Úsympy.matricesr   Úsympy.matrices.expressionsr   Úsympy.utilities.iterablesr   r   Úsympy.utilities.miscr   r   r   Úentityr   Úmpmath.libmp.libmpfr   r   rC   rD   rS   r.   r,   ú<module>r7     s  ððð ð& €€€à 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø Ð Ð Ð Ð Ð Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø $Ð $Ð $Ð $Ð $Ð $Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø =Ð =Ð =Ð =Ð =Ð =Ð =Ð =Ø !Ð !Ð !Ð !Ð !Ð !Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ø CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ Cà "Ð "Ð "Ð "Ð "Ð "à +Ð +Ð +Ð +Ð +Ð +ðo ð o ð o ð o ð o ˆNñ o ô o ð o ðdSð Sð Sð Sð Sˆeñ Sô Sð Sðjqð qð qð qð qˆeñ qô qð qð qð qr.   