
    \h)                         S r SSKJr  SSKJr  SSKJrJr  SSKJ	r	J
r
  SSKJrJr  SSKJrJrJrJrJr  SSKJr  SS	KJr  SS
KJr  SSKJr   " S S\
5      rg)z4Parabolic geometrical entity.

Contains
* Parabola

    )S)ordered)_symbolsymbols)GeometryEntityGeometrySet)PointPoint2D)LineLine2DRay2D	Segment2DLinearEntity3D)Ellipse)sign)simplify)solvec                       \ rS rSrSrSS jr\S 5       r\S 5       r\S 5       r	\S 5       r
SS	 jr\S
 5       r\S 5       rS r\S 5       r\S 5       rSrg)Parabola   a  A parabolic GeometryEntity.

A parabola is declared with a point, that is called 'focus', and
a line, that is called 'directrix'.
Only vertical or horizontal parabolas are currently supported.

Parameters
==========

focus : Point
    Default value is Point(0, 0)
directrix : Line

Attributes
==========

focus
directrix
axis of symmetry
focal length
p parameter
vertex
eccentricity

Raises
======
ValueError
    When `focus` is not a two dimensional point.
    When `focus` is a point of directrix.
NotImplementedError
    When `directrix` is neither horizontal nor vertical.

Examples
========

>>> from sympy import Parabola, Point, Line
>>> p1 = Parabola(Point(0, 0), Line(Point(5, 8), Point(7,8)))
>>> p1.focus
Point2D(0, 0)
>>> p1.directrix
Line2D(Point2D(5, 8), Point2D(7, 8))

Nc                     U(       a  [        USS9nO[        SS5      n[        U5      nUR                  U5      (       a  [        S5      e[        R
                  " XU40 UD6$ )N   )dimr   z*The focus must not be a point of directrix)r	   r   contains
ValueErrorr   __new__)clsfocus	directrixkwargss       O/var/www/auris/envauris/lib/python3.13/site-packages/sympy/geometry/parabola.pyr   Parabola.__new__A   sZ    %Q'E!QKEO	e$$IJJ%%c)FvFF    c                     g)a   Returns the ambient dimension of parabola.

Returns
=======

ambient_dimension : integer

Examples
========

>>> from sympy import Parabola, Point, Line
>>> f1 = Point(0, 0)
>>> p1 = Parabola(f1, Line(Point(5, 8), Point(7, 8)))
>>> p1.ambient_dimension
2

r    selfs    r!   ambient_dimensionParabola.ambient_dimensionO   s    & r#   c                 L    U R                   R                  U R                  5      $ )a  Return the axis of symmetry of the parabola: a line
perpendicular to the directrix passing through the focus.

Returns
=======

axis_of_symmetry : Line

See Also
========

sympy.geometry.line.Line

Examples
========

>>> from sympy import Parabola, Point, Line
>>> p1 = Parabola(Point(0, 0), Line(Point(5, 8), Point(7, 8)))
>>> p1.axis_of_symmetry
Line2D(Point2D(0, 0), Point2D(0, 1))

)r   perpendicular_liner   r&   s    r!   axis_of_symmetryParabola.axis_of_symmetryd   s    0 ~~00<<r#   c                      U R                   S   $ )a1  The directrix of the parabola.

Returns
=======

directrix : Line

See Also
========

sympy.geometry.line.Line

Examples
========

>>> from sympy import Parabola, Point, Line
>>> l1 = Line(Point(5, 8), Point(7, 8))
>>> p1 = Parabola(Point(0, 0), l1)
>>> p1.directrix
Line2D(Point2D(5, 8), Point2D(7, 8))

   argsr&   s    r!   r   Parabola.directrix~       0 yy|r#   c                 "    [         R                  $ )a7  The eccentricity of the parabola.

Returns
=======

eccentricity : number

A parabola may also be characterized as a conic section with an
eccentricity of 1. As a consequence of this, all parabolas are
similar, meaning that while they can be different sizes,
they are all the same shape.

See Also
========

https://en.wikipedia.org/wiki/Parabola


Examples
========

>>> from sympy import Parabola, Point, Line
>>> p1 = Parabola(Point(0, 0), Line(Point(5, 8), Point(7, 8)))
>>> p1.eccentricity
1

Notes
-----
The eccentricity for every Parabola is 1 by definition.

)r   Oner&   s    r!   eccentricityParabola.eccentricity   s    B uur#   c                 p   [        USS9n[        USS9nU R                  R                  nU[        R                  L aG  SU R
                  -  XR                  R                  -
  -  nX R                  R                  -
  S-  nXE-
  $ US:X  aG  SU R
                  -  X R                  R                  -
  -  nXR                  R                  -
  S-  nXE-
  $ U R                  u  pgU R                  R                  SS u  pX-
  S-  X'-
  S-  -   nU R                  R                  X5      S-  US-  U	S-  -   -  nXE-
  $ )a  The equation of the parabola.

Parameters
==========
x : str, optional
    Label for the x-axis. Default value is 'x'.
y : str, optional
    Label for the y-axis. Default value is 'y'.

Returns
=======
equation : SymPy expression

Examples
========

>>> from sympy import Parabola, Point, Line
>>> p1 = Parabola(Point(0, 0), Line(Point(5, 8), Point(7, 8)))
>>> p1.equation()
-x**2 - 16*y + 64
>>> p1.equation('f')
-f**2 - 16*y + 64
>>> p1.equation(y='z')
-x**2 - 16*z + 64

Treal   r   r   N)r   r   sloper   Infinityp_parametervertexxyr   coefficientsequation)
r'   r@   rA   mt1t2abcds
             r!   rC   Parabola.equation   s'   6 AD!AD!NN  

?d&&'1{{}}+<=Bkkmm#a'B w !Vd&&'1{{}}+<=Bkkmm#a'B w	 ::DA>>..r2DA%!quqj(B((.11a4!Q$;?Bwr#   c                 Z    U R                   R                  U R                  5      nUS-  nU$ )a  The focal length of the parabola.

Returns
=======

focal_lenght : number or symbolic expression

Notes
=====

The distance between the vertex and the focus
(or the vertex and directrix), measured along the axis
of symmetry, is the "focal length".

See Also
========

https://en.wikipedia.org/wiki/Parabola

Examples
========

>>> from sympy import Parabola, Point, Line
>>> p1 = Parabola(Point(0, 0), Line(Point(5, 8), Point(7, 8)))
>>> p1.focal_length
4

r   )r   distancer   )r'   rM   focal_lengths      r!   rN   Parabola.focal_length   s+    < >>**4::6zr#   c                      U R                   S   $ )a  The focus of the parabola.

Returns
=======

focus : Point

See Also
========

sympy.geometry.point.Point

Examples
========

>>> from sympy import Parabola, Point, Line
>>> f1 = Point(0, 0)
>>> p1 = Parabola(f1, Line(Point(5, 8), Point(7, 8)))
>>> p1.focus
Point2D(0, 0)

r   r0   r&   s    r!   r   Parabola.focus
  r3   r#   c           
         [        SSS9u  p#U R                  5       n[        U[        5      (       aR  X;   a  U/$ [	        [        [        XAR                  5       /X#/SS9S    Vs/ s H  n[        U5      PM     sn5      5      $ [        U[        5      (       aA  [        UR                  X!R                  S   4X1R                  S   4/5      5      S:X  a  U/$ / $ [        U[        [        45      (       ax  [        U[        UR                  S   UR                  S   5      R                  5       /X#/SS9S   n[	        [        U Vs/ s H  oUU;   d  M
  [        U5      PM     sn5      5      $ [        U[        [         45      (       aJ  [	        [        [        XAR                  5       /X#/SS9S    Vs/ s H  n[        U5      PM     sn5      5      $ [        U["        5      (       a  [%        S5      e[%        S5      es  snf s  snf s  snf )	ab  The intersection of the parabola and another geometrical entity `o`.

Parameters
==========

o : GeometryEntity, LinearEntity

Returns
=======

intersection : list of GeometryEntity objects

Examples
========

>>> from sympy import Parabola, Point, Ellipse, Line, Segment
>>> p1 = Point(0,0)
>>> l1 = Line(Point(1, -2), Point(-1,-2))
>>> parabola1 = Parabola(p1, l1)
>>> parabola1.intersection(Ellipse(Point(0, 0), 2, 5))
[Point2D(-2, 0), Point2D(2, 0)]
>>> parabola1.intersection(Line(Point(-7, 3), Point(12, 3)))
[Point2D(-4, 3), Point2D(4, 3)]
>>> parabola1.intersection(Segment((-12, -65), (14, -68)))
[]

zx yTr9   )setr/   r   z5Entity must be two dimensional, not three dimensionalzWrong type of argument were put)r   rC   
isinstancer   listr   r   r	   r
   r   subs_argsr   r   r   pointsr   r   	TypeError)r'   or@   rA   parabola_eqiresults          r!   intersectionParabola.intersection$  s   8 u4(mmoa""ys
Gu **,/!T8CCD8F %G 8F!U1X 8F %G H I I7##((1ggaj/Awwqz?)KLMQRRs
	Iu-..Kqxx{AHHQK099;=D""#%F V FVAvV FGHHFG,--Ujjl+aV6??@6B !C 6B 6B !C D E E>**STT=>>%%G !G!Cs   $G=	HH2Hc                    U R                   R                  nU[        R                  L a?  U R                   R                  S   n[        U R                  R                  S   U-   5      nOUS:X  a?  U R                   R                  S   n[        U R                  R                  S   U-   5      nOQU R                   R                  U R                  5      n[        U R                  R                  UR                  -
  5      nX0R                  -  $ )ae  P is a parameter of parabola.

Returns
=======

p : number or symbolic expression

Notes
=====

The absolute value of p is the focal length. The sign on p tells
which way the parabola faces. Vertical parabolas that open up
and horizontal that open right, give a positive value for p.
Vertical parabolas that open down and horizontal that open left,
give a negative value for p.


See Also
========

https://www.sparknotes.com/math/precalc/conicsections/section2/

Examples
========

>>> from sympy import Parabola, Point, Line
>>> p1 = Parabola(Point(0, 0), Line(Point(5, 8), Point(7, 8)))
>>> p1.p_parameter
-4

r   r   r/   )r   r<   r   r=   rB   r   r   r1   
projectionr@   rN   )r'   rD   r@   prA   rJ   s         r!   r>   Parabola.p_parameterZ  s    B NN  

?++A.ATZZ__Q'!+,A!V++A.ATZZ__Q'!+,A))$**5ATZZ\\ACC'(A$$$$r#   c                    U R                   nU R                  R                  nU[        R                  L a5  [        UR                  S   U R                  -
  UR                  S   5      nU$ US:X  a5  [        UR                  S   UR                  S   U R                  -
  5      nU$ U R                  R                  U 5      S   nU$ )a  The vertex of the parabola.

Returns
=======

vertex : Point

See Also
========

sympy.geometry.point.Point

Examples
========

>>> from sympy import Parabola, Point, Line
>>> p1 = Parabola(Point(0, 0), Line(Point(5, 8), Point(7, 8)))
>>> p1.vertex
Point2D(0, 4)

r   r/   )
r   r   r<   r   r=   r	   r1   r>   r,   r^   )r'   r   rD   r?   s       r!   r?   Parabola.vertex  s    . 

NN  

?5::a=4+;+;;UZZ]KF
 	 !V5::a=%**Q-$:J:J*JKF  **77=a@Fr#   r%   )NN)r@   rA   )__name__
__module____qualname____firstlineno____doc__r   propertyr(   r,   r   r6   rC   rN   r   r^   r>   r?   __static_attributes__r%   r#   r!   r   r      s    *XG  ( = =2  2    D*X    D  24?l *% *%X  r#   r   N)rj   
sympy.corer   sympy.core.sortingr   sympy.core.symbolr   r   sympy.geometry.entityr   r   sympy.geometry.pointr	   r
   sympy.geometry.liner   r   r   r   r   sympy.geometry.ellipser   sympy.functionsr   sympy.simplify.simplifyr   sympy.solvers.solversr   r   r%   r#   r!   <module>rw      s;     & . = / N N *   , 'R{ Rr#   