�
��g: � �� � d Z ddlmZ ddlmZ ddlmZ ddlmZm Z m
Z
ddlmZ ddl
mZ ddlmZ dd lmZmZmZ dd
lmZ ddlmZ ddlmZmZmZmZ d
dlmZm Z d
dl!m"Z" d
dl#m$Z$m%Z% d
dl&m'Z'm(Z( ddl)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6m7Z7 ddl8Z8d� e9d� � D � � \ Z:Z; G d� de � � Z< G d� de<� � Z= G d � d!e<� � Z> G d"� d#e<� � Z? G d$� d%e<� � Z@ G d&� d'e@e=� � ZA G d(� d)e@e>� � ZB G d*� d+e@e?� � ZC G d,� d-e<� � ZD G d.� d/eDe=� � ZE G d0� d1eDe>� � ZF G d2� d3eDe?� � ZGdS )4z�Line-like geometrical entities.
Contains
========
LinearEntity
Line
Ray
Segment
LinearEntity2D
Line2D
Ray2D
Segment2D
LinearEntity3D
Line3D
Ray3D
Segment3D
� )�Tuple)�N)�Expr)�Rational�oo�Float)�Eq)�S)�ordered)�_symbol�Dummy�uniquely_named_symbol)�sympify)� Piecewise)� _pi_coeff�acos�tan�atan2� )�GeometryEntity�GeometrySet)�
GeometryError)�Point�Point3D)�find�intersection)�And)�Matrix)�Intersection��simplify)�solve)�
linear_coeffs)�Undecidable�
filldedentNc �, � g | ]}t d � � ��S )�
line_dummy)r
��.0�is �c/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sympy/geometry/line.py�
<listcomp>r, / s � �.�.�.���l���.�.�.� � c � � e Zd ZdZdd�Zd� Zd� Zed� � � Zd� Z d� Z
dd
�Zed� � � Z
d� Zed
� � � Zd� Zd� Zd� Zd� Zed� � � Zed� � � Zed� � � Zd� Zd� Zd� Zed� � � Zd� Zdd�Zd� ZdS )�LinearEntityan A base class for all linear entities (Line, Ray and Segment)
in n-dimensional Euclidean space.
Attributes
==========
ambient_dimension
direction
length
p1
p2
points
Notes
=====
This is an abstract class and is not meant to be instantiated.
See Also
========
sympy.geometry.entity.GeometryEntity
Nc � � t j ||� � \ }}||k rt d| j z � � �t |� � t |� � k rt d| j z � � �t j | ||fi |��S )N�&%s.__new__ requires two unique Points.z2%s.__new__ requires two Points of equal dimension.)r �_normalize_dimension�
ValueError�__name__�lenr �__new__��cls�p1�p2�kwargss r+ r7 zLinearEntity.__new__K s� � ��+�B��3�3���B�
��8�8� �8�3�<�G�I� I�
I��r�7�7�c�"�g�g����D�s�|�S�U� U�
U� �%�c�2�r�<�<�V�<�<�<r- c �` � | � |� � }|�|S t d| �d|�d�� � �)z}Return a definitive answer or else raise an error if it cannot
be determined that other is on the boundaries of self.NzCannot decide whether 'z' contains '�')�containsr$ )�self�other�results r+ �__contains__zLinearEntity.__contains__X sG � � ���u�%�%�����M��+�>B�d�d�E�E�E�J�L� L�
Lr- c �x � | j |k rdS || j z
}| j }|� |� � dk rdS dS )a Test whether the point `other` lies in the positive span of `self`.
A point x is 'in front' of a point y if x.dot(y) >= 0. Return
-1 if `other` is behind `self.p1`, 0 if `other` is `self.p1` and
and 1 if `other` is in front of `self.p1`.r r �����)r: � direction�dot)r@ rA �rel_pos�ds r+ �
_span_testzLinearEntity._span_testc sG � �
�7�e����1��$�'�/���N���5�5��>�>�A����1��rr- c �* � t | j � � S )aC A property method that returns the dimension of LinearEntity
object.
Parameters
==========
p1 : LinearEntity
Returns
=======
dimension : integer
Examples
========
>>> from sympy import Point, Line
>>> p1, p2 = Point(0, 0), Point(1, 1)
>>> l1 = Line(p1, p2)
>>> l1.ambient_dimension
2
>>> from sympy import Point, Line
>>> p1, p2 = Point(0, 0, 0), Point(1, 1, 1)
>>> l1 = Line(p1, p2)
>>> l1.ambient_dimension
3
)r6 r: �r@ s r+ �ambient_dimensionzLinearEntity.ambient_dimensionq s � �>