�
��g�P � �, � d Z ddlmZ ddlmZ ddlmZ ddlm Z ddl
mZ ddlm
Z
mZmZ dd lmZ dd
lmZ ddlmZmZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlm Z ddl!mZ ddl"m#Z# ddl$m%Z% d� Z&d� Z'd� Z(d� Z)d� Z*d� Z+dd�d�Z,d� Z-d"d�Z.dd�d �Z/d!S )#z�Utility functions for geometrical entities.
Contains
========
intersection
convex_hull
closest_points
farthest_points
are_coplanar
are_similar
� )�deque)�sqrt)� nsimplify� )�GeometryEntity)�
GeometryError)�Point�Point2D�Point3D)�
OrderedSet)�factor_terms)�Function�
expand_mul)�Float)�ordered)�Symbol)�S)�cancel)�is_sequence)�prec_to_dpsc � � � |j }� fd�|D � � }|st d� z � � �t |� � dk rt d� z � � �|d S )a�
Checks whether a Symbol matching ``x`` is present in ``equation``
or not. If present, the matching symbol is returned, else a
ValueError is raised. If ``x`` is a string the matching symbol
will have the same name; if ``x`` is a Symbol then it will be
returned if found.
Examples
========
>>> from sympy.geometry.util import find
>>> from sympy import Dummy
>>> from sympy.abc import x
>>> find('x', x)
x
>>> find('x', Dummy('x'))
_x
The dummy symbol is returned since it has a matching name:
>>> _.name == 'x'
True
>>> find(x, Dummy('x'))
Traceback (most recent call last):
...
ValueError: could not find x
c �X �� g | ]&}t �t � � r|j n|�k �$|��'S � )�
isinstance�str�name)�.0�i�xs ��c/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sympy/geometry/util.py�
<listcomp>zfind.<locals>.<listcomp>A s8 �� � H� H� H��
�1�c�(:�(:�A�a�f�f��a�G�G�!�G�G�G� zcould not find %sr zambiguous %sr )�free_symbols�
ValueError�len)r �equation�free�xss ` r �findr) # sm �� �: � �D� H� H� H� H�T� H� H� H�B�
� 2��,�q�0�1�1�1�
�2�w�w�!�|�|���!�+�,�,�,�
�a�5�Lr"