
    \h                     V    S SK Jr  S SKJr  S SKJr  S SKrS rS rS r	S
S jr
S
S	 jrg)    )Float)Dummy)lambdifyNc                     U c  g[        U [        5      (       a  g[        R                  " U 5      (       + =(       a    [        R                  " U 5      (       + $ )z)Check if a floating point number is validF)
isinstancecomplexmathisinfisnan)xs    O/var/www/auris/envauris/lib/python3.13/site-packages/sympy/plotting/textplot.pyis_validr      s;    y!Wzz!}2TZZ]!22    c                 t   / nXC-
  nXC-   S-  n[        U5       H  n[        X   5      (       au  X   U-
  U-  n	[        U	5      (       d  UR                  S5        MB  [        X-  US-  -   US-
  -  U-  5      R	                  5       n
[        U
5      n
UR                  U
5        M  UR                  S5        M     U$ )z{Rescale the given array `y` to fit into the integer values
between `0` and `H-1` for the values between ``mi`` and ``ma``.
   N   )ranger   appendr   roundint)yWHmimay_newnormoffsetr   
normalizedrescaleds              r   rescaler!      s     E7Dg]F1XAD>>$-4/JJ''T" *,1"41!=a!?@FFHx=X&LL  Lr   c                 ^    [        U5       Vs/ s H  o0X-
  U-  US-
  -  -   PM     sn$ s  snf )Nr   )r   )startstopnumr   s       r   linspacer&   (   s1    :?*E*QT\Q&#a%00*EEEs   *c              #   Z  #    U R                   n[        U5      S:  a  [        SR                  U5      5      eU(       a  UR	                  5       O	[        5       n[        U/U 5      n[        U[        5      (       a  UR                  S:X  a  UR                  n[        U[        5      (       a  UR                  S:X  a  UR                  n[        U5      n[        U5      n[        XU5      n/ nU H  n	 UR                  U" U	5      5        M     [!        [#        [$        U5      5      n
U
(       a:  ['        U
5      n[)        U
5      nX:X  a  U(       a  [+        SSU-  /5      u  pO	Su  pOSu  pX-
  n[,        R.                  " [,        R0                  " U5      5      S-
  nUS-  n[3        X5      n[3        X5      n[5        XXLU5      n[        XU5      nSn[7        US-
  SS5       GH  nS	/U-  n[7        U5       H{  nUU   U:X  d  M  US:X  d  UUS-
     US-
  :X  a  UUS-
  :X  d  UUS-      US-   :X  a  S
UU'   MB  US:X  d  UUS-
     US-   :X  a  UUS-
  :X  d  UUS-      US-
  :X  a  SUU'   Mv  SUU'   M}     US:X  a  [7        U5       H  nSUU'   M
     USUS-  US-
  4;   a  SUU   -  R9                  U5      SU nOS	U-  nSR;                  U5      nUUS-  :X  a  UR=                  S	S5      nUS-   U-   v   GM     S	US-   -  nUSUS   -  R?                  US-  5      -  nUS-  S:X  a   USXcS-     -  R?                  US-  5      -  nO"USXcS-     -  R?                  US-  S-
  5      -  nUSUS   -  -  nUv   g! [        [        [        4 a    UR                  S5         GM  f = f7f)z#Generator for the lines of the plotr   z4The expression must have a single variable. (Got {})r   Nr   )r   r(       /\._z%g -z |) free_symbolslen
ValueErrorformatpopr   r   r   r   imagrealfloatr&   r   	TypeErrorZeroDivisionErrorlistfilterr   maxminsortedr	   floorlog10r   r!   r   rjustjoinreplaceljust)exprabr   r   freer   fr   valy_validr   r   y_range	precisiony_binsmarginhsiprefixbottoms                         r   textplot_strrV   ,   s    D
4y1}BVD\ 	 
A!dA!W66Q;A!W66Q;AaAaA 	qA
A	HHQsV  6(A&'G\\8AbD	*BgG

4::g./!3IOI	r	B	r	BaR Aba F F1q5"b!EAIqAtqyFaAh!a%/a1q5jAa!eHPQTUPUDUAaD1f!a%AE 1QU
aAhRSVWRWFWAaDAaD  61X!  AqD!a%  VAY&--f5gv>FZFGGAJ19		#s#Atma/ "4 FQJF
tad{!!!Q$''F1uz4!qD'>((A..4!qD'>((Aa00
dQrUlF
Lw I'89 	HHTNN	s2   C/N+2M=	C8N+E8N+=&N(#N+'N((N+c                 B    [        XX#U5       H  n[        U5        M     g)aC  
Print a crude ASCII art plot of the SymPy expression 'expr' (which
should contain a single symbol, e.g. x or something else) over the
interval [a, b].

Examples
========

>>> from sympy import Symbol, sin
>>> from sympy.plotting import textplot
>>> t = Symbol('t')
>>> textplot(sin(t)*t, 0, 15)
 14 |                                                  ...
    |                                                     .
    |                                                 .
    |                                                      .
    |                                                .
    |                            ...
    |                           /   .               .
    |                          /
    |                         /      .
    |                        .        .            .
1.5 |----.......--------------------------------------------
    |....       \           .          .
    |            \         /                      .
    |             ..      /             .
    |               \    /                       .
    |                ....
    |                                    .
    |                                     .     .
    |
    |                                      .   .
-11 |_______________________________________________________
     0                          7.5                        15
N)rV   print)rF   rG   rH   r   r   lines         r   textplotrZ      s    H TaA.d /r   )7      )sympy.core.numbersr   sympy.core.symbolr   sympy.utilities.lambdifyr   r	   r   r!   r&   rV   rZ    r   r   <module>ra      s-    $ # - 3.FTn%r   