
    \h'                         S r SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
Jr  SSKJr  SSKJr  SS	KJrJr  SS
KJr  SSKJr   " S S\5      rg)zCCurves in 2-dimensional Euclidean space.

Contains
========
Curve

    )sqrt)diff)Tuple)_symbol)GeometryEntityGeometrySet)Point)	integrate)Matrix	rot_axis3)is_sequence)prec_to_dpsc                       \ rS rSrSrS rS rS rSS jrSS jr	\
S 5       r\
S	 5       r\
S
 5       r\
S 5       r\
S 5       r\
S 5       rSS jrSS jrSS jrSS jrSrg)Curve   a  A curve in space.

A curve is defined by parametric functions for the coordinates, a
parameter and the lower and upper bounds for the parameter value.

Parameters
==========

function : list of functions
limits : 3-tuple
    Function parameter and lower and upper bounds.

Attributes
==========

functions
parameter
limits

Raises
======

ValueError
    When `functions` are specified incorrectly.
    When `limits` are specified incorrectly.

Examples
========

>>> from sympy import Curve, sin, cos, interpolate
>>> from sympy.abc import t, a
>>> C = Curve((sin(t), cos(t)), (t, 0, 2))
>>> C.functions
(sin(t), cos(t))
>>> C.limits
(t, 0, 2)
>>> C.parameter
t
>>> C = Curve((t, interpolate([1, 4, 9, 16], t)), (t, 0, 1)); C
Curve((t, t**2), (t, 0, 1))
>>> C.subs(t, 4)
Point2D(4, 16)
>>> C.arbitrary_point(a)
Point2D(a, a**2)

See Also
========

sympy.core.function.Function
sympy.polys.polyfuncs.interpolate

c                 "   [        U5      (       a  [        U5      S:w  a  [        S[        U5      -  5      e[        U5      (       a  [        U5      S:w  a  [        S[        U5      -  5      e[        R
                  " U [        U6 [        U6 5      $ )N   z3Function argument should be (x(t), y(t)) but got %s   z3Limit argument should be (t, tmin, tmax) but got %s)r   len
ValueErrorstrr   __new__r   )clsfunctionlimitss      L/var/www/auris/envauris/lib/python3.13/site-packages/sympy/geometry/curve.pyr   Curve.__new__L   s    8$$H(: "8}- . .6""c&kQ&6 "6{+ , , %%c5(+;UF^LL    c                 :    U R                  U R                  U5      $ N)subs	parameter)selffs     r   __call__Curve.__call__V   s    yy++r   c           	          XR                   :X  a1  [        U R                   Vs/ s H  o3R                  X5      PM     sn6 $ g s  snf r    )r"   r	   	functionsr!   )r#   oldnewr$   s       r   
_eval_subsCurve._eval_subsY   s9    .. T^^D^66#+^DEE !Ds   Ac           
         U R                   u  nu  pEn[        U5      n[        U Vs/ s H  oR                  " SSU0UD6PM     sn5      nXV4 Vs/ s H  oR                  " SSU0UD6PM     snu  pVU R	                  X4XV45      $ s  snf s  snf )Nn )argsr   tupleevalffunc)	r#   precoptionsr$   tabdpsis	            r   _eval_evalfCurve._eval_evalf]   s    yy9A!$a8a77,S,G,a89456:6a)#))6:yyI&& 9:s   BB
c           	      ~   Uc  [        U R                  6 $ [        XR                  SS9nU R                  nUR                  UR                  :w  a9  UR                  S U R
                   5       ;   a  [        SUR                  -  5      e[        U R                   Vs/ s H  oDR                  X25      PM     sn6 $ s  snf )a  A parameterized point on the curve.

Parameters
==========

parameter : str or Symbol, optional
    Default value is 't'.
    The Curve's parameter is selected with None or self.parameter
    otherwise the provided symbol is used.

Returns
=======

Point :
    Returns a point in parametric form.

Raises
======

ValueError
    When `parameter` already appears in the functions.

Examples
========

>>> from sympy import Curve, Symbol
>>> from sympy.abc import s
>>> C = Curve([2*s, s**2], (s, 0, 2))
>>> C.arbitrary_point()
Point2D(2*t, t**2)
>>> C.arbitrary_point(C.parameter)
Point2D(2*s, s**2)
>>> C.arbitrary_point(None)
Point2D(2*s, s**2)
>>> C.arbitrary_point(Symbol('a'))
Point2D(2*a, a**2)

See Also
========

sympy.geometry.point.Point

Trealc              3   8   #    U  H  oR                   v   M     g 7fr    )name).0r$   s     r   	<genexpr>(Curve.arbitrary_point.<locals>.<genexpr>   s     @.?ff.?s   zFSymbol %s already appears in object and cannot be used as a parameter.)r	   r(   r   r"   rA   free_symbolsr   r!   )r#   r"   tnewr6   ws        r   arbitrary_pointCurve.arbitrary_pointd   s    X $..))y..t<NNII		@d.?.?@@ 57;yyA B B?1vva?@@?s   B:c                     [        5       nU R                  U R                  SS -    H  nXR                  -  nM     UR	                  U R
                  15      nU$ )aT  Return a set of symbols other than the bound symbols used to
parametrically define the Curve.

Returns
=======

set :
    Set of all non-parameterized symbols.

Examples
========

>>> from sympy.abc import t, a
>>> from sympy import Curve
>>> Curve((t, t**2), (t, 0, 2)).free_symbols
set()
>>> Curve((t, t**2), (t, a, 2)).free_symbols
{a}

   N)setr(   r   rE   
differencer"   )r#   freer7   s      r   rE   Curve.free_symbols   sN    , u$++ab/1ANN"D 2/0r   c                 2    [        U R                  S   5      $ )zThe dimension of the curve.

Returns
=======

int :
    the dimension of curve.

Examples
========

>>> from sympy.abc import t
>>> from sympy import Curve
>>> C = Curve((t, t**2), (t, 0, 2))
>>> C.ambient_dimension
2

r   )r   r0   r#   s    r   ambient_dimensionCurve.ambient_dimension   s    * 499Q<  r   c                      U R                   S   $ )a  The functions specifying the curve.

Returns
=======

functions :
    list of parameterized coordinate functions.

Examples
========

>>> from sympy.abc import t
>>> from sympy import Curve
>>> C = Curve((t, t**2), (t, 0, 2))
>>> C.functions
(t, t**2)

See Also
========

parameter

r   r0   rQ   s    r   r(   Curve.functions       2 yy|r   c                      U R                   S   $ )a  The limits for the curve.

Returns
=======

limits : tuple
    Contains parameter and lower and upper limits.

Examples
========

>>> from sympy.abc import t
>>> from sympy import Curve
>>> C = Curve([t, t**3], (t, -2, 2))
>>> C.limits
(t, -2, 2)

See Also
========

plot_interval

rK   rU   rQ   s    r   r   Curve.limits   rW   r   c                 &    U R                   S   S   $ )zThe curve function variable.

Returns
=======

Symbol :
    returns a bound symbol.

Examples
========

>>> from sympy.abc import t
>>> from sympy import Curve
>>> C = Curve([t, t**2], (t, 0, 2))
>>> C.parameter
t

See Also
========

functions

rK   r   rU   rQ   s    r   r"   Curve.parameter  s    2 yy|Ar   c                    ^  [        [        U 4S jT R                   5       5      5      n[        UT R                  5      $ )zThe curve length.

Examples
========

>>> from sympy import Curve
>>> from sympy.abc import t
>>> Curve((t, t), (t, 0, 1)).length
sqrt(2)

c              3   \   >#    U  H!  n[        UTR                  S    5      S-  v   M#     g7f)r   r   N)r   r   )rB   r3   r#   s     r   rC   Curve.length.<locals>.<genexpr>,  s%     V~tT$A7:~s   ),)r   sumr(   r
   r   )r#   	integrands   ` r   lengthCurve.length  s/     Vt~~VVW	DKK00r   c                 b    [        XR                  SS9nU/[        U R                  SS 5      -   $ )a;  The plot interval for the default geometric plot of the curve.

Parameters
==========

parameter : str or Symbol, optional
    Default value is 't';
    otherwise the provided symbol is used.

Returns
=======

List :
    the plot interval as below:
        [parameter, lower_bound, upper_bound]

Examples
========

>>> from sympy import Curve, sin
>>> from sympy.abc import x, s
>>> Curve((x, sin(x)), (x, 1, 2)).plot_interval()
[t, 1, 2]
>>> Curve((x, sin(x)), (x, 1, 2)).plot_interval(s)
[s, 1, 2]

See Also
========

limits : Returns limits of the parameter interval

Tr>   rK   N)r   r"   listr   )r#   r"   r6   s      r   plot_intervalCurve.plot_interval/  s1    B I~~D9sT$++ab/***r   Nc                    U(       a  [        USS9* nO[        SS5      nU R                  " UR                  6 n[        UR                  5      nUR                  S5        [        SSU5      nU[        U5      -  nU R                  USSS24   R                  5       S   U R                  5      nU* nUR                  " UR                  6 $ )af  This function is used to rotate a curve along given point ``pt`` at given angle(in radian).

Parameters
==========

angle :
    the angle at which the curve will be rotated(in radian) in counterclockwise direction.
    default value of angle is 0.

pt : Point
    the point along which the curve will be rotated.
    If no point given, the curve will be rotated around origin.

Returns
=======

Curve :
    returns a curve rotated at given angle along given point.

Examples
========

>>> from sympy import Curve, pi
>>> from sympy.abc import x
>>> Curve((x, x), (x, 0, 1)).rotate(pi/2)
Curve((-x, x), (x, 0, 1))

r   dimr   rK   r   N)r	   	translater0   rd   r(   appendr   r   r3   tolistr   )r#   angleptrvr$   s        r   rotateCurve.rotateS  s    : ""BqB^^RWW%	1aO	YuYYqBQBx(+T[[9S||RWW%%r   c                    U(       aJ  [        USS9nU R                  " U* R                  6 R                  X5      R                  " UR                  6 $ U R                  u  pEU R                  XA-  XR-  4U R                  5      $ )a  Override GeometryEntity.scale since Curve is not made up of Points.

Returns
=======

Curve :
    returns scaled curve.

Examples
========

>>> from sympy import Curve
>>> from sympy.abc import x
>>> Curve((x, x), (x, 0, 1)).scale(2)
Curve((2*x, x), (x, 0, 1))

r   rh   )r	   rj   r0   scaler(   r3   r   )r#   xyrn   fxfys         r   rs   Curve.scale}  sj    $ rq!B>>RC::.44Q:DDbggNNyy"$t{{33r   c                 b    U R                   u  p4U R                  X1-   XB-   4U R                  5      $ )zTranslate the Curve by (x, y).

Returns
=======

Curve :
    returns a translated curve.

Examples
========

>>> from sympy import Curve
>>> from sympy.abc import x
>>> Curve((x, x), (x, 0, 1)).translate(1, 2)
Curve((x + 1, x + 2), (x, 0, 1))

)r(   r3   r   )r#   rt   ru   rv   rw   s        r   rj   Curve.translate  s-    $ yy"&"&)4;;77r   r/   )   )r6   )r   N)rK   rK   N)r   r   )__name__
__module____qualname____firstlineno____doc__r   r%   r+   r;   rH   propertyrE   rR   r(   r   r"   ra   re   rp   rs   rj   __static_attributes__r/   r   r   r   r      s    3jM,F'5An  6 ! !,  4  4  4 1 1"+H(&T408r   r   N)r   (sympy.functions.elementary.miscellaneousr   
sympy.corer   sympy.core.containersr   sympy.core.symbolr   sympy.geometry.entityr   r   sympy.geometry.pointr	   sympy.integralsr
   sympy.matricesr   r   sympy.utilities.iterablesr   mpmath.libmp.libmpfr   r   r/   r   r   <module>r      s8    :  ' % = & % , 1 +R8K R8r   