�
��gW� � �� � d Z ddlmZ ddlmZ ddlmZmZmZ ddl m
Z
ddlmZ ddl
mZ ddlmZmZ dd lmZ dd
lmZmZmZ ddlmZmZ ddlmZmZ dd
lmZm Z ddl!m"Z" ddl#m$Z$m%Z% ddl&m'Z' ddl(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z. ddl/m0Z0m1Z1m2Z2 ddl3m4Z4m5Z5 ddl6m7Z7m8Z8m9Z9 ddl:m;Z;m<Z< ddl=m>Z> ddl?m@Z@ ddlAmBZBmCZC ddlDmEZE ddlFZFd� eGd� � D � � \ ZHZI G d� de%� � ZJ G d � d!eJ� � ZKdd"lLmMZMmNZN dS )#z?Elliptical geometrical entities.
Contains
* Ellipse
* Circle
� )�Expr)�Eq)�S�pi�sympify)�N)�global_parameters)�
fuzzy_bool)�Rational�oo)�ordered)�Dummy�uniquely_named_symbol�_symbol)�simplify�trigsimp)�sqrt�Max)�cos�sin)�
elliptic_e� )�GeometryEntity�GeometrySet)�
GeometryError)�Line�Segment�Ray2D� Segment2D�Line2D�LinearEntity3D)�Point�Point2D�Point3D)�idiff�find)�DomainError�Poly�PolynomialError)�_not_a_coeff�_nsort)�solve)�
linear_coeffs)�
filldedent� func_name)�prec_to_dpsNc �0 � g | ]}t d d�� � ��S )�
ellipse_dummyT��real)r ��.0�is �f/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sympy/geometry/ellipse.py�
<listcomp>r9 % s% � �<�<�<�a��o�D�)�)�)�<�<�<� � c � � � e Zd ZdZd� Zd� Z� fd�Z d0d�Zd1d �Ze d
� � � Z
e d� � � Zd2d
�Ze d� � � Z
e d� � � Ze d� � � Ze d� � � Ze d� � � Zd� Zd3d�Zd4d�Ze d� � � Ze d� � � Ze d� � � Zd� Zd� Ze d� � � Ze d� � � Zd5d�Ze d � � � Ze d!� � � Zd"� Zd#� Z d2d$�Z!d5d%�Z"d&� Z#d6� fd(� Z$d7d*�Z%d+� Z&e d,� � � Z'd5d-�Z(d.� Z)d5d/�Z*� xZ+S )8�Ellipsea" An elliptical GeometryEntity.
Parameters
==========
center : Point, optional
Default value is Point(0, 0)
hradius : number or SymPy expression, optional
vradius : number or SymPy expression, optional
eccentricity : number or SymPy expression, optional
Two of `hradius`, `vradius` and `eccentricity` must be supplied to
create an Ellipse. The third is derived from the two supplied.
Attributes
==========
center
hradius
vradius
area
circumference
eccentricity
periapsis
apoapsis
focus_distance
foci
Raises
======
GeometryError
When `hradius`, `vradius` and `eccentricity` are incorrectly supplied
as parameters.
TypeError
When `center` is not a Point.
See Also
========
Circle
Notes
-----
Constructed from a center and two radii, the first being the horizontal
radius (along the x-axis) and the second being the vertical radius (along
the y-axis).
When symbolic value for hradius and vradius are used, any calculation that
refers to the foci or the major or minor axis will assume that the ellipse
has its major radius on the x-axis. If this is not true then a manual
rotation is necessary.
Examples
========
>>> from sympy import Ellipse, Point, Rational
>>> e1 = Ellipse(Point(0, 0), 5, 1)
>>> e1.hradius, e1.vradius
(5, 1)
>>> e2 = Ellipse(Point(3, 1), hradius=3, eccentricity=Rational(4, 5))
>>> e2
Ellipse(Point2D(3, 1), 3, 9/5)
c �L � t |t � � rs| � t t � � � t |j t |j i� � }t
t |� � � � t j u S t |t � � r| |k S dS )NF)�
isinstancer"