
    sg                        d dl mZmZmZmZ d dlmZ d dlmZ d dl	m
Z
mZ d dlmZ d dlmZmZmZ d dlmZ d dlmZ d d	lmZ d d
lmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z& d dl'm(Z( d dl)m*Z+ d dl,m-Z- d dl.m/Z/m0Z0  e
dd      Z1 e
dd      Z2 e
dd      Z3 e
dd      Z4 e
dd      Z5 e
dd      Z6 e
dd      Z7 edd      \  Z8Z9 edd      Z:d Z;d Z<d Z=d Z>d Z?d Z@d  ZAd! ZBd" ZCd# ZDd$ ZEd% ZFd& ZGd' ZHd( ZId) ZJd* ZKd+ ZLd, ZMd- ZNd. ZOd/ ZPd0 ZQd1 ZRd2 ZSd3 ZTd4 ZUd5 ZVd6 ZWd7 ZXd8 ZYd9 ZZd: Z[d; Z\d< Z]d= Z^d> Z_y?)@    )FloatRationaloopi)Eq)S)Symbolsymbols)sqrt)acoscossin)EmptySet)simplify)tan)CircleGeometryErrorLinePointRaySegmentTriangleintersectionPoint3DLine3DRay3D	Segment3DPoint2DLine2DPlane)Undecidable)_asa)cartes)raiseswarnsxTrealyzkx1y1ta,bmc                      ddl mmm m t        dz  z   dz         t        t        dd      t        dd            k(  sJ t        dz  dz  z   dz         t        t        dt        d	d            t        dt        d
d                  k(  sJ t        d z  z   dz   dd      t        t        dd      t        dd            k(  sJ t        dz  z         t        t        dd      t        dd            k(  sJ t        z         t        t        dd      t        dd	            k(  sJ t        t        d z  z   d      d      t        t        dd      t        dd            k(  sJ t        dz
        t        t        dd      t        dd            k(  sJ t        dz  dz
        t        t        dd      t        dd            k(  sJ t              t        t        dd      t        dd            k(  sJ t        dz        t        t        dd      t        dd            k(  sJ t              t        t        dd      t        dd            k(  sJ t        t        fd       t        t         fd       t        t        fd       t        t         fd       t        t        fd       y )Nr   )r&   r)   ab      i   i   r2   r3   r&   r)      )r)   )r&   c                       t         z        S Nr   r:   s   Q/var/www/html/venv/lib/python3.12/site-packages/sympy/geometry/tests/test_line.py<lambda>z+test_object_from_equation.<locals>.<lambda>/       tAE{     c                  &    t         z  dd      S Nr2   r3   r:   r?   r2   r3   s   r@   rA   z+test_object_from_equation.<locals>.<lambda>0       tAESC8 rC   c                       t         z        S r>   r?   r:   s   r@   rA   z+test_object_from_equation.<locals>.<lambda>1   rB   rC   c                  &    t         z  dd      S rE   r?   rF   s   r@   rA   z+test_object_from_equation.<locals>.<lambda>2   rG   rC   c                  ,    t         dz   dz  z         S )Nr6   r<   r?   r:   s   r@   rA   z+test_object_from_equation.<locals>.<lambda>3   s    tQUQJN3 rC   )	sympy.abcr&   r)   r2   r3   r   r   r   r   r   r$   
ValueError)r2   r3   r&   r)   s   @@@@r@   test_object_from_equationrM      sl   $$!a"3C!IIII!a!ea F8B?#WQQ%@%B B B B!a"s+v3C0* * * *!a=F71a='!R.AAAAA;&A2????1Q37C C1-3C2* * * * A;&A1>>>>!a11wq!}!EEEE7fWQ]GAqM::::!q>VGAqM71a=AAAAQ<6'!Q-A????
:*+
:89
:*+
:89
:34rC   c                 @    t        d      }| | |z
  cxk  xr |k  S c S )z.Test if two floating point values are 'equal'.z1.0E-10)r   )r2   r3   t_floats      r@   feqrP   6   s(    IG8a!e%g%%%%rC   c                  8   t        dddd      } | j                  }| j                  }t        t	        j
                  t	        t        dd      t        dd            t	        t        dd      t        dd                  j                         t        j                         dz        sJ t	        | |      j                  t	        ||            t        dz  k(  sJ t        ddd      }t        j
                  t        |t        ddd            t        |t        ddd                  t        t        d      dz        k(  sJ t        j
                  t        |t        ddd            t        t        ddd      |            t        t        d       dz        k(  sJ y )Nr6   r<   r4      r   r7   )r   orthogonal_directionoriginrP   r   angle_betweenevalfr   r   r   r   r   )r2   r3   or*   s       r@   test_angle_betweenrX   <   sn   aAqA	A	At!!$uQ{E!QK"@"&uQ{E!QK"@BBG%'288:XY>[ [ [1:##DAJ/269991aAq'!Q*: ; &q'!Q*: ;=@DT!Wq[@QR R R q'!Q*: ; &wq!Q'7 ;=@Dd1gXPQ\@RS S SrC   c                      t        dd      } t        dt        dz        }| j                  |      t         dz  k(  sJ |j                  |       t        dz  k(  sJ | j                  |       dk(  sJ y )Nr   r   r   angler6   r<   r<   )r   r   closing_anglerF   s     r@   test_closing_angler_   K   sm    F!AF"Q$A??1"Q&&&??1A%%%??1"""rC   c                      t        t        dd      t        dd            } t        t        dd      t        dd            }| j                  |      t        dt	        d      z  dz        k(  sJ y )Nr6   r<   r4   r7   )r   r   smallest_angle_betweenr   r   rF   s     r@   test_smallest_anglerb   S   s\    U1a[%1+&AU1a[q!%A##A&$qay{*;;;;rC   c                  B   t        t        dd      t        dd            } | j                         dk(  sJ t        t        dd      t        dd            } | j                         dk(  sJ t	        t        dd      t        dd            } | j                         dk(  sJ y )	Nr6   r<   z<path fill-rule="evenodd" fill="#66cc99" stroke="#555555" stroke-width="2.0" opacity="0.6" d="M 1.00000000000000,1.00000000000000 L 1.00000000000000,2.00000000000000" marker-start="url(#markerReverseArrow)" marker-end="url(#markerArrow)"/>r   z<path fill-rule="evenodd" fill="#66cc99" stroke="#555555" stroke-width="2.0" opacity="0.6" d="M 1.00000000000000,0 L 1.00000000000000,1.00000000000000" />r4   r7   z<path fill-rule="evenodd" fill="#66cc99" stroke="#555555" stroke-width="2.0" opacity="0.6" d="M 2.00000000000000,3.00000000000000 L 3.00000000000000,5.00000000000000" marker-start="url(#markerCircle)" marker-end="url(#markerArrow)"/>)r   r   _svgr   r   )r2   s    r@   test_svgre   Y   s    U1a[q!%A668  I  I  I  IaE!QK(A668  t  t  t  tE!QKq!%A668  C  C  C  CrC   c                     t        t        ddd      t        ddd            } t        t        t        t              t        t
        t
                    }|j                         |v sJ t        dt        dz        j                         t        t        dz   t        dz         k(  sJ t        dd      j                         t        dt        z   ddt        z  z         k(  sJ | j                  | j                               | j                         k(  sJ t        dg d	
      j                         t        t        dz   dt        z  dz   dt        z  dz         k(  sJ t        t        ddd      t        ddd            j                  t        t        j                   t        j                   t        j                         k(  sJ t        t        t        t        t              t        t
        t
        t
                    j"                  t%        d      t%        t        t
        z
  dz        z  k(  sJ t        dd      j                         t        t        dz   dt        z  dz   dt        z  dz         k(  sJ t'        t(        d        y )Nr   r6   r6   r6   rR   r[   r<   r4   r<   r6   r6   r6   r6   r<   r4   direction_ratior4   r<   r4   rR   c                  L    t        t        dfd      j                  t              S )Nr6   rh   )r   r&   arbitrary_point rC   r@   rA   z&test_arbitrary_point.<locals>.<lambda>q   s    aVV 4 D DQ G rC   )r   r   r   r   r,   r-   ro   r   r   r.   r   perpendicular_segmentr   r   midpointr   Halflengthr   r$   rL   l1l2s     r@   test_arbitrary_pointrx   b   s   	1a '!Q"2	3B	eBmU2r]	+B2%%%vR!V$446QA  66"224a!eQQY8OOOO##B$6$6$89R=O=O=QQQQI6FFH1q5!a%!)QUQY/0 0 0WQ1%wq!Q'78AA166166166*+ + +WRR('"b"*=>EEaSWY[^`Y`efXfSgIggggY	*::<1q5!a%!)QUQY/0 0 0
:GIrC   c                  V   t        t        dd      t        dd            } t        t        t        t              t        t        dt        z               }t        j                  |       du sJ t        j                  | |      sJ t        j                  | | | |      sJ t        j                  | |t        t        dt              t        t	        dd      t                          sJ t        j                  | t        t        dd      t        t         t                    |      du sJ y )Nr   r6   Fr7   r;   )r   r   r,   are_concurrentr   ru   s     r@   test_are_concurrent_2dr{   t   s    	eAqk5A;	'B	eBmU2q2v.	/Br"e+++r2&&&r2r2...r2tE!RL%QQS:T'UVVVr4aUB3^#DbIURRRrC   c                     t        ddd      } t        | t        ddd            }t        t        ddd      t        ddd            }t        t        ddd      t        ddd            }t        j                  |      du sJ t        j                  |t        t        t        t        t              t        t
        t
        t
                          du sJ t        j                  |t        | t        t        t        t                    t        t        t        t        t              t        t        dt        z   d                  du sJ t        j                  ||      du sJ y Nr   r6   FT)r   r   r   rz   r,   r-   )p1rv   
parallel_1
parallel_2s       r@   test_are_concurrent_3dr   ~   s"   	Aq	B	b'!Q"	#B1a('!Q*:;J1a('!Q*:;J  $---  T'"b"*=wr2r?R%STX]]]]  VBB0C%D!%gb"b&972q2vq;Q!RTW[\ \ \  Z8EAAArC   c            	         ddl m}  dddgt        dd      f} | |d      }t        t	        dd      t	        dd            }dg d	t        ddd
      f} | |d      }t        t        ddd      t        ddd            }dg dt        dddd      f} | |d      }t        t        dddd      t        dddd            }	g d}
|D ]
  }t        |   |
D ]  }|D ]  } t        ||      |         |D ]
  }t        |   |
D ]  }|D ]  } t        ||      |         |D ]
  }t        |   |
D ]  }|D ]  } t        |	|      |         y)zFunctions accepting `Point` objects in `geometry`
    should also accept tuples, lists, and generators and
    automatically convert them to points.r   )subsetsr]   r6   r4   r7   r<   rj   )r6   r<   rR      )r6   r<   r4   rR   )r6   r<   r4   r7      rR   )containsdistanceequalsparallel_lineperpendicular_linerq   
projectionr   N)	sympy.utilities.iterablesr   r   r   r   r   r   getattrr   )r   	singles2d	doubles2dl2d	singles3d	doubles3dl3d	singles4d	doubles4dl4dtest_singlepfuncs                r@   test_argumentsr      s    2!Qq!-I	1%I
wq!}gam
,CIuQ1~6I	1%I
wq!QAq!1
2C|U1aA->?I	1%I
uQ1a %1a"3
4C1K 
 " 	"AGCq!	""  
 " 	"AGCq!	""  a " 	"AGCq!	""rC   c            
         t        dd      } t        dd      }t        dd      }t        | |      j                         }t        ||       j                         }t        | |      }t        t        t        t              t        t        dt        z               }t        | t        dd            }t        | t        dd            }t        t        dd      |       }	t        | |      }
|
j                         }t        dd      t        dd      k(  sJ t        dt              t        dd      k(  sJ t        dt              j                  dk(  sJ t        dt               t        dd      k(  sJ t        | |      j                  d	d      t        | t        d	d            k(  sJ t        | |      t        | |      k(  sJ t        | |      t        ||       k7  sJ |t        t        t        t              t        t        t                    k7  sJ ||k7  sJ t        | |      t        ||       k7  sJ t        | |      | k7  sJ | |v sJ | |vsJ |
t        | |      v sJ t        t        dd      t        dd            t        t        dd      t        dd	            v sJ t        t        dd      t        dd	            t        t        dd      t        dd            v sJ t        t        dd      t        dd	            j                  t        j                  k(  sJ t        t        dd      t        dd	            j                  t        j                  k(  sJ t        t        dd      t        d
d	            j                  t        j                  k(  sJ t        t        dd      t        d	d            j                  t        j                  k(  sJ t        t        dd      t        d	d	            j                  t        j                  k(  sJ t        t        dd      t        d	d            j                  t        j                  k(  sJ ||
v du sJ t        | |      |
v sJ t        t        t        t              t        t        dt        z               t        | t        d
d            k7  sJ t        | |      j                   t        t        j"                  t        j"                        k(  sJ t        | t        t         t                    j$                  t'        d	t        d	z  z        k(  sJ |j(                  dk(  sJ |j(                  t        u sJ |j(                  dk(  sJ t        | t        dd            j(                  t        u sJ t        |j*                  |j                               j(                  |j(                  k(  sJ t        |	j*                  |	j                               j(                  |	j(                  k(  sJ t        t        dd
      t        | t        dd            j                               j(                  t        | t        dd            j(                  k(  sJ |j,                  dk(  sJ t        t.         t.        ft.         dz   t.        dz
  f      j,                  dk(  sJ t        | t        dd            j,                  dk(  sJ t        dt.              }|j1                  t.        dt2        z  dz        t        dd      k(  sJ |j1                  t.        dt2        z  dz        t        dd      k(  sJ |j1                  t.        t2         dz        t        dd      k(  sJ |j1                  t.        t2        d	z        t        dd      k(  sJ |j1                  t.        t2         d	z        t        dd      k(  sJ t5        dd      D ]  }|j                         |v rJ  |j.                  | j.                  k\  r|j6                  | j6                  k\  sJ |j.                  |j.                  k  r|j6                  |j6                  k  sJ | j.                  |j.                  cxk  r|j.                  k  r0n J | j6                  |j6                  cxk  r|j6                  k  sJ  J t9        |
      t9        t        ||             k7  sJ |
j;                         t<        ddgk(  sJ t        | |      j;                         t<        ddgk(  sJ t        dt2        dz        j;                         t<        ddgk(  sJ y )Nr   r6     rg   sloper<   r<   r]   )r6   r6   r6   r<   r<   r8   Fr7   r   r6   r   r6   r6   r   r6   r   r   rZ   r[   r4   rR   r8   r6   )r8   r8   )r6   r8   r   r6   r   r8   
   )r   r   random_pointr   r,   r   r   boundsscaler-   
xdirectionr   ZeroInfinityNegativeInfinity
ydirectionrr   rs   rt   r   r   sourcecoefficientsr&   subsr   ranger)   hashplot_intervalr.   )r~   p2p10p_r3p_r4rv   l3l4r1r2s1p_s1rinds                 r@   test_basic_properties_2dr      s   	q!B	q!B
d
Cr2;##%Dr2;##%D	b"B	eBmU2q2v.	/B	b%1+	B	Rq!	B	U1a["	B	S	B??Da D$8888b!T&&%9999b!((L888rc"d66&::::B<a#tBa'<<<<B<4B<'''B<4B<'''eBmU2r]33338O8C=DbM)))C=B8O8R<<b#uQ{E!QK(CaU1a[,IIIIuQ{E!QK(CaU1a[,IIIIuQ{E!QK(33qvv===uQ{E!QK(33qzzAAAuQ{E"aL)448J8JJJJuQ{E!QK(33qvv===uQ{E!QK(33qzzAAAuQ{E!RL)448J8JJJJ"H2r?b   uR}eBB/0CE"aL4IIII2r?##uQVVQVV'<<<<2ubS"~&--a27m1DDDD88q==88r>>88q==E!QK &&",,,		2??,-33rxx???		2??,-33rxx???5B<U1a[!9!F!F!HIOOSZ[]_defhi_jSkSqSqqqq??i'''!Q1"q&!a%)66)CCCE!QK --:::F!A66!QVaZ C$888866!QVaZ C$999966!bS1WVW!555566!R!VFF 333366!bS1WVW!5555Q{ ' B&&&' 66RTT>dffn,,66RTT>dffn,,44466"SUU">>rtttvv'>'>>>'>>>8tGC,----!Q***C=&&(QAJ666vR!V$224Ar
BBBrC   c            
         t        ddd      } t        ddd      }t        t        t        t              }t        t        dt        z   d      }t        | |      }t        ||      }t        | t        ddd            }t        | |      }t	        | |      }t        dg d      t        t        ddd      t        dd	d            k(  sJ t        dg d
      t        t        ddd      t        ddd            k(  sJ t        dg d      t        t        ddd      t        ddd	            k(  sJ t        t        ddd      t        ddd            j
                  g dk(  sJ t        t        | t        ddd                  t        | t        ddd            k(  sJ t        t        t        ddd      t        ddd                  t        | t        ddd            k(  sJ t        | |      t        ||       k7  sJ ||k7  sJ |t        |t        t        t        t                    k7  sJ ||k7  sJ t        t        ddd      t        ddd            t        t        ddd      t        ddd            v sJ t        t        ddd      t        ddd            t        t        ddd      t        ddd            v sJ t        t        ddd      t        ddd            j                  t        j                  k(  sJ t        t        ddd      t        ddd            j                  t        j                  k(  sJ t        t        ddd      t        ddd            j                  t        j                  k(  sJ t        t        ddd      t        ddd            j                  t        j                  k(  sJ t        t        ddd      t        ddd            j                  t        j                  k(  sJ t        t        ddd      t        ddd            j                  t        j                  k(  sJ t        t        ddd      t        ddd            j                  t        j                  k(  sJ t        t        ddd      t        ddd            j                  t        j                  k(  sJ t        t        ddd      t        ddd            j                  t        j                  k(  sJ | |v sJ | |vsJ |j                  g dk(  sJ |j                  t        t        j                   t        j                   t        j                         k(  sJ t        | t        ddd            j                  t        j                  u sJ y )Nr   r6   r8   r7   ri   rm   rk   r4   rR   )r6   r7   r   r<   r      rj   r   r   )r   r,   r   r   r   direction_cosiner-   r   r   r   r   
zdirectionr   r   rl   rr   rs   )	r~   r   p3p5rv   r   r   r3r   s	            r@   test_basic_properties_3dr      s   	Aq	B	Aq	B	R	B	QVQ	B	BB	BB	r72q!$	%B	r2B	2r	B)Y76'!QPQBRT[\]_`bcTd;eeee)Y76'!QPQBRT[\]_`bcTd;eeee)Y76'!QPQBRT[\]_`bcTd;eeee'!Q"GAq!$45FF)SSS&WQ1-./6"gaA>N3OOOO1a('!Q*:;<b'RSUVXYJZ@[[[["b>VB^+++8O8GBB/00008O8Aq!71a#34gaA>NPWXY[\^_P`8aaaaAq!71a#34gaA>NPWXY[\^_P`8aaaaAq!71a#34??1::MMMAq!71a#34??1::MMMAq!71a#34??1::MMMAq!72q!#45@@ADVDVVVVAq!71b!#45@@ADVDVVVVAq!71a#45@@ADVDVVVVAq!71a#34??166IIIAq!71a#34??166IIIAq!71a#34??166III8O8R<<***;;'!&&!&&!&&9999WQ2&'22a6H6HHHHrC   c            
         t        dd      } t        | t        dd            }t        | t        ddd            }t        | t        ddd            }t        | t        ddd            }t	        t        dd      t        dd            }t        dt
        t        z   dz        t        dt
        fdt        f      v sJ t        t
        t        z   dz  d      t        t
        dft        df      v sJ t        ddd      t        dd      v sJ t        ddd      t        dd      v sJ t        t        ddd      t        ddd            j                  g       d	u sJ t        t        ddd      t        ddd            j                  t        t        ddd      t        ddd                  d
u sJ |j                  t        dd            d	u sJ |j                  d      d	u sJ |j                  d      d
u sJ |j                  |       d	u sJ |j                  d      d	u sJ |j                  d      d
u sJ |j                  t        dd            d	u sJ |j                  t        dd            d
u sJ |j                  t        dd            d	u sJ |j                  t        dd            d
u sJ |j                  t        | t        ddd                  d	u sJ |j                  t        t        ddd      t        ddd                  d
u sJ |j                  t        ddd            d	u sJ |j                  t        ddd            d	u sJ t        t        ddd      t        ddd            j                  g       d
u sJ t        dt        t        t        f      j                  dt        z  dt        z  dt        z  f      sJ t        t        d
      5  t        | t        ddd            j                  t        dd            d
u sJ 	 d d d        t        t        d
      5  |j                  t        dd            d
u sJ 	 d d d        y # 1 sw Y   DxY w# 1 sw Y   y xY w)Nr   rR   r8   r6   r4   r<   r   r   TFr   rZ   rg   )r6   r4   r   r]   )r<   r7   )r4   r4   )r4   r7   r   r   r   test_stacklevel      ?)r   r   r   r   r   r2   r3   r   r   r   r   r&   r)   r*   r%   UserWarning)r~   r   r   r   r   ls         r@   test_containsr   )  s/   	q!BBaA	r71a$	%B	r71a#	$B	r71a#	$BU1a[%1+&AQUaK GQFQF$;;;;!a%1a GQFQF$;;;;1ayI>>>>1ayI>>>>WQ1%wq!Q'78AA"EMMMWQ1%wq!Q'78AA'!Q"GAq!$457:?@ @ @ ::eAqk"d***::f%%%::f&&&::b>T!!!::f%%%::f&&&::gff-.$666::gff-.%777::c&&)*d222::c&&)*e333;;yWQ3%789TAAA;;yAq!171a3CDENNN;;wq!Q'(D000;;wq!Q'(D000Aq!71a#34==bAUJJJ)aAY'00!a%QA1FGGG	{E	2 Ob'!Q*+44U3_ENNNO 
{E	2 5{{5c?+u4445 5O O5 5s   5Q, Q"Q"Q+c                      t        d      \  } }}}t        t        | |      t        ||            }t        | t        dd      z  |dz  z   |t        dd      z  |dz  z         }|j	                  |      sJ y )Nz
u, v, w, zr<   r4   )r
   r   r   r   r   )uvwr*   r   r   s         r@   test_contains_nonreal_symbolsr   S  sp    &JAq!QaU1a[)AaA1$aA&61&<=A::a==rC   c                     t        dd      } t        dd      }t        j                  }t        t        dd      t        dd            }t        t        ||      t        dd            }t	        | |      }|j                  t        dd            dk(  sJ |j                  d      dk(  sJ |j                  t        dd            d|z  dz  k(  sJ |j                  t        t        d      dz  t        d      dz              d|z  k(  sJ t        | |      j                  t        dd            t        d      k(  sJ t        | |      j                  t        dd            t        d      k(  sJ t        | |      j                  t        dd            dk(  sJ t        | |      j                  d      t        d      k(  sJ t        dd      j                  |       dk(  sJ t        dd      j                  |      dk(  sJ t        dd	      j                  |       dk(  sJ t        dd	      j                  |      dk(  sJ |j                  t        dd            t        d      k(  sJ |j                  t        dd            dk(  sJ |j                  t        dd            t        d      k(  sJ t	        d
d      j                  t        dd            dt        d      z  dz  k(  sJ |j                  d
      dk(  sJ y )Nr   r6   rZ   r<   r4   r8   r   r   r6   r   rg   r         ?rR   )	r   r   rs   r   r   r   r   r   r   )r~   r   halfr   s2r   s         r@   test_distance_2dr   Z  s   	q!B	q!B66D	q!eAqk	*B	tT"E!QK	0BBA;;uQ{#q(((;;v!###;;uQ{#qDy1}444;;uXa[1_hqkAo>?19LLLB<  r1.$q'999B<  q".$q'999B<  q!-222B<  )T!W444((,111((,111((,111((,111::eBm$Q///::eAqk"a'''::eBl#tAw...vv''c16!d1g+/III::f"""rC   c                      t        t        d      5  t        dd      t        dd      k(  sJ 	 d d d        y # 1 sw Y   y xY w)NFr   rg   )r<   r6   r<   r   )r%   r   r   rp   rC   r@   test_dimension_normalizationr   w  sA    	{E	2 C69%Y	)BBBBC C Cs	   8Ac                  h   t        ddd      t        ddd      }} t        t        d      dz  t        d      dz  t        d      dz        }t        t        ddd      t        ddd            }t        t        t        j                  t        j                  t        j                        t        ddd            }t        | |      }|j                  |       dk(  sJ |j                  |       t        d      dz  k(  sJ |j                  |      dt        d      z  dz  k(  sJ |j                  d      dk(  sJ |j                  d      t        d      dz  k(  sJ |j                  |       dk(  sJ |j                  |       t        d      dz  k(  sJ |j                  |      dt        d      z  dz  k(  sJ |j                  d      dk(  sJ |j                  d      t        d      dz  k(  sJ t        | |      j                  t        ddd            dt        d      z  dz  k(  sJ t        | |      j                  t        ddd            dt        d      z  dz  k(  sJ t        | |      j                  t        ddd            dk(  sJ t        | |      j                  d      dk(  sJ t        | |      j                  d	      dt        d      z  dz  k(  sJ t        dd
      j                  |       dk(  sJ t        dd
      j                  |      t        d      k(  sJ t        dd      j                  |       dk(  sJ t        dd      j                  |      t        d      k(  sJ t        dd      j                  t        dd            dk(  sJ t        dd      j                  t        dd            dk(  sJ t        dd      j                  t        dd            dk(  sJ t        dd      j                  t        d
d            dk(  sJ t        dd      j                  t        dd            dk(  sJ t        dd      j                  t        d
d
            dk(  sJ t        dd      j                  t        dd            dk(  sJ |j                  t        ddd            t        d      k(  sJ |j                  t        ddd            dk(  sJ |j                  d      t        d      k(  sJ |j                  d      dk(  sJ t        dd      j                  d      dt        d      z  dz  k(  sJ t        dd      j                  t        ddd            t        d      dz  k(  sJ t        dd      j                  t        ddd            t        d      dz  k(  sJ y )Nr   r6   r4   r<   r   r   r8   )r<   r<   r<   )r6   r8   r6   r   r   r   r6   r<   )r   r   r   )r   r6   r<   r   r6   r6   )r<   r   r   r   r   r6   )r6   r6   r4   )r8   r8   r8   ri   )r6   r6   r<   )r8   r8   r<   rR   r   r;   	   N   )
r   r   r   r   rs   r   r   r   r   r    )r~   r   r   r   r   r   s         r@   test_distance_3dr   |  s/   Q1wq!Q/B	!q(1+/8A;?	CB	71a#WQ1%5	6B	71661661662GAq!4D	EBb"A;;r?a;;r?d1gk)));;r?a$q'kAo---;;y!Q&&&;;y!T!Wq[000;;r?a;;r?d1gk)));;r?a$q'kAo---;;y!Q&&&;;y!T!Wq[000"b>""72q!#45T!WqHHH"b>""71b!#45T!WqHHH"b>""71a#34999"b>""9-222"b>"":.!d1g+/AAA)Y'004999)Y'004Q???)Y'004999)Y'004Q???)Y'00	91MNRSSSS)Y'00	91MNRSSSS)Y'00
J1OPTUUUU)Y'00	91MNRSSSS)Y'00y)1LMQRRRR)Y'00y)1LMQRRRR)Y'00y)1LMQRRRR::gb"b)*d1g555::gaA&'1,,,::l#tAw...::i A%%%I&//<DGaOOOI&//R0DERSWXXXXI&//Q0BCtBxRS|SSSrC   c            
      	   t        dd      } t        dd      }t        | |      }t        dt              }t        t        t        t              t        t        dt        z               }|j	                  | j
                        j                  t        t        dd      t        dd                  sJ |j	                  |       j                  t        t        dd      t        dd                  sJ t        t        t        t              t        t        t                    j                  t        t         t                    j                  t        t        t         t              t        t         dt        z  t        z
                    sJ |j                  | j
                        j                  t        t        dd      t        dd                  sJ |j                  |       j                  t        t        dd      t        dd                  sJ |j                  t        dd            dt        t        dz         z  t        t        dz  dz         z  z
  j                  d      sJ t        | t        ddd            j                  t        dd            d	u sJ t        t        ddd      t        ddd            j                  t        t        d
dd      t        ddd                  du sJ t        t        ddd      t        ddd            j                  t        | t        ddd                  d	u sJ t        | t        ddd            j                  t        dd            d	u sJ t        | t        ddd            j                  t        | t        ddd                  du sJ t        dt        t        f      j	                  t        ddd            j                  t        t        ddd      t        t         j"                  t         j"                  d                  sJ t        dt        t        f      j%                  t        ddd            j                  t'        dt         j"                  t         j"                  f            sJ t        | t        ddd            j                  t        dd            d	u sJ y )Nr   r6   )r   r7   r   r8   r<   r4   r   Fr   TrZ   r   )r   r   r0   r,   r   argsr   r-   r   r   absr   r   r   r   r.   r   rs   rq   r   )r~   r   rv   rw   r   s        r@   test_equalsr     s   	q!B	q!B	b"B	fA	B	eBmU2q2v.	/B  )00eAqk5B<1PQQQ  $++Dq!eArl,KLLLb"uR}-;;E2#rNKtE2#rNE2#q2v{$;<=> > >BGG$++Dq!eArl,KLLLB&&tE!QKq"'FGGGKKa$q3q1u:~Q!VaZ8H'HHPPQRSSS"gaA&'..uS#?5HHH'!Q"GAq!$45<<VGBPQSTDUW^_acdfgWh=ijnrrrr'!Q"GAq!$45<<VBPQSTVWHX=YZ^ccccWQ2&'..uS#?5HHHWQ2&'..uRAr9J/KLPTTTT&1a&!44U1a^DKKwq!Q!;<> > >&1a&!77aAGNNyY_bcbhbhjkjpjpaqOrsss"gaA&'..uS#?5HHHrC   c                     t        dd      } t        dd      }t        | |      }t        t        t        t              t        t        dt        z               }t        |j	                               t
        t        z
  t        t
        z
  fv sJ t        |j	                               t
        t        z
  t        t
        z
  fv sJ t        |j	                               t
        t        z
  t        t
        z
  fv sJ t        |j	                               t
        t        z
  t        t
        z
  fv sJ t        | t        dd            j	                  t
        t              t        k(  sJ t        | t        dd            j	                         t
        k(  sJ t        t        dd      t        dd            j	                         t
        dz
  k(  sJ t        |t        dd            j	                         t        dz
  k(  sJ t        t        t        t        t              t        t        t        t                    j	                         t
         t        z   t
         t        z   fk(  sJ t        t        ddd      t        ddd            j	                         t
         t        z   dz
  t
         t        z   dz
  fk(  sJ t        t        ddd      t        ddd            j	                         t
        dz
  t         t        z   dz
  fk(  sJ t        t        ddd      t        ddd            j	                         t        dz
  t
         t        z   dz
  fk(  sJ t        t        ddd      t        ddd            j	                         t
         t        z   dz
  t        dz
  fk(  sJ t        t        ddd      t        ddd            j	                         t
        dz
  t        dz
  fk(  sJ t        t        ddd      t        ddd            j	                         t
        dz
  t        dz
  fk(  sJ t        t        ddd      t        ddd            j	                         t        dz
  t        dz
  fk(  sJ y )Nr   r6   r:   r<   r4   rR   )
r   r   r,   r   equationr&   r)   r   r-   r*   )r~   r   rv   r   s       r@   test_equationr     s   	q!B	q!B	b"B	eBmU2q2v.	/BBKKM"q1ua!en444BKKM"q2vrAv&6666BKKM"q1ua!en444BKKM"q2vrAv&6666E!QK ))A)3q888E!QK ))+q000aU1a[)224A===E!QK ))+q1u444%B#U2r2%6 

(*!a!a() ) )%1a.%1a. 

(*!a!aR!VaZ01 1 1%1a.%1a. 

(*QQ
+, , ,%1a.%1a. 

(*QQ
+, , ,%1a.%1a. 

(*!a!QU+, , ,%1a.%1a. 

(*QA' ' '%1a.%1a. 

(*QA' ' '%1a.%1a. 

(*QA' ' 'rC   c                     t        dd      } t        dd      }t        t        t              }t        t        t              }t        | |      }t        t        dd      t        dd            }t	        t        dd      t        dd            }t	        t        dd      t        dd            }t	        | |      }t	        t        dd      t        dd            }	t	        t        dd      t        dd            }
t        | |      }t        t        dd      t        dd            }t        t        dd      t        dd            }t        ||       | gk(  sJ t        |t        t        dt        z               g k(  sJ t        |t        ||            |gt        ||      gfv sJ t        ||j                  t        t        dt        z                     g k(  sJ t        ||      |gk(  sJ t        ||      |gk(  sJ t        ||      |gk(  sJ t        ||      |gk(  sJ t        t        t        dd	      t        d	d	            t        t        d
d
      t        d
d                  g k(  sJ t        ||      |gk(  sJ t        |t	        t        dd      t        dd                  t        t        dd      t        dd            gk(  sJ t        |t	        t        dd      t        dd                  t        dd      gk(  sJ t        |t        t        dd      t        dd                  t        t        dd      t        dd            gk(  sJ |j                  |      |gk(  sJ |j                  t        t        dd      t        dd                  g k(  sJ |j                  t        t        dd      t        dd                  t        | t        dd            gk(  sJ |j                  t	        ||             |gk(  sJ t	        ||       j                  |	      g k(  sJ |j                  |
      |
j                  |      cxk(  r|
gk(  sJ  J t        dd      j                  t        dd            t        dd      gk(  sJ t        dd      j                  t        dd            t        dd      gk(  sJ t	        t        dd      t        dd            j                  t	        t        dd      t        dd                  t        t        dd      t        dd            gk(  sJ t        dd      j                  t        dd            t        dd      gk(  sJ t        dd      j                  t        dd            t        dd      gk(  sJ t        dd      j                  t        dd            t        d      gk(  sJ t        dd      j                  t        dd            t        dd      gk(  sJ t        dd      j                  t        dd            t        dd      gk(  sJ t        dd      j                  t        dd            t        dd      gk(  sJ |j                  t        t        dd      t        dd                  t        dd      gk(  sJ |j                  t        t        dd      t        dd                  t        t        dd      |      gk(  sJ |j                  t        t        dd      t        dd                  g k(  sJ |j                  t        t        dd      |             | gk(  sJ |j                  t        t        dd      t        dd                  t        | t        dd            gk(  sJ |j                  t        t        dd      t        dd                  g k(  sJ |j                  |      |gk(  sJ |j                  |      |gk(  sJ t        ddd      t        t        dd      t        dd      t        dt        dt        z  dz        z  t        dt        z  dz        z  dt!        d      z  t        dt        z  dz        z  t        dt        z  dz        z              k(  sJ t        dd      j                  t	        dd            t        dd      gk(  sJ t        dd      j                  t        dd            t        dd      gk(  sJ t	        dd      j                  t	        dd            t        dd      gk(  sJ t	        dd      j                  t        dd            t        dd      gk(  sJ t	        dd      j#                  t        dd            d u sJ t        dd      t        dd      v sJ |j                  t	        dd!            t        dd      gk(  sJ y )"Nr   r6   r4   rR   r<         ?g      ?r   r   r   r7   r8   rZ   )r4   r   r   )r<   r   )rR   r   )r7   r   r   r   r   x   r   4   r9      Z   -   rg   r]   )r   r   r   T)rR   rR   )r   r,   r-   r   r   r   r   r   r   r   r   asar   r   r   r   r   r   )r~   r   r   p4rv   r   r   r   r4r6r7r   r   s3s                 r@   test_intersection_2dr     s$	   	q!B	q!B	r2B	r2B	b"B	eAqk5A;	'B	U1a[%1+	&B	U1a[%1+	&B	RB	U1a[%1+	&B	U3_eAqk	*B	RB	tT"E#sO	4B	q!eAqk	*BBB4'''E"a"f-."444DRL)rdT"b\N-CCCCB,,U2q2v->?@BFFFBB4'''BB4'''BB4'''BB4'''c2b">bRTW\]_abWc@deikkkkBB4'''CaU1a[9:wuQPQ{TYZ[]^T_?`>aaaaCaU2r];<q!MMMGE!QKq!=>75QRTU;X]^_abXcCdBeeee??22$&&&??75A;a<=CCC??75R=%S/BCPRTYZ]_bTcHdGeeee??3r2;'B4///r2;##B'2---??2"//""5="===== --eFF.CDvW]I^H____ --eFF.CDvW]I^H____uQ{E!QK(55c%1+uQPR|6TUE!QKq!-./ / / VV$11&&!#'0'@&AB B BVV$11&&!#'0'@&AB B BVV$11&&!#'.v&78 8 8VV$11&&!#'0'@&AB B BVV$11'6"$(1&&(A'BC C CVV$11'6"$(/17 7 7??75A;a<=%1+NNN??75c?E#sODE'RWX[]`RaceJfIgggg??75A;a<=CCC??75R="562$>>>??75R=%S/BCPRTYZ]_bTcHdGeeee??4aU1a[9:b@@@??22$&&&??22$&&&sAr?Q{Q{R#b2gl++c!b&2+.>>a[3rBw|#44s1r6B;7GGIJJ J J ,,S-@AeAqk]RRR,,WVV-DE%PQST+VVVvv++C,?@U1a[MQQQvv++GFF,CDqRSUUUvx ))'&&*ABdJJJ66"d68&<<<<??3vv./E!QK=@@@rC   c            	      .   t        t        t        dd      z        } t        d      }| dz  }d| z  | |z   z  d| z  d|z  |z  z
  |dz
  z  g\  }}t	        t        dd      t        dt        d                   j                  t        ||            d	u sJ y )
N   r   r4   r<   r      r   r6   T)r   r   r   r   r   r   r   )x0r,   x2r&   r)   s        r@   test_line_intersectionr  R  s    	RR  	!B	aB	QBbD"r'NRUQrT"W_rAv67DAqaU1tAwh/099%1+F$NNNrC   c                     t        ddd      } t        ddd      }t        | |      }t        t        ddd      t        ddd            }t        t        ddd      t        ddd            }t        t        ddd      t        ddd            }t        t        ddd      t        ddd            }t	        ||       | gk(  sJ t	        |t        t
        dt
        z   d            g k(  sJ t	        ||j                  |             t        t        ddd      t        ddd            gk(  sJ t	        ||      |gk(  sJ t	        ||      |gk(  sJ t	        ||      |gk(  sJ t	        |t        t        ddd      t        ddd                  t        ddd      gk(  sJ t	        |t        t        ddd      t        ddd                  t        t        ddd      t        ddd            gk(  sJ t	        t        t        ddd      t        ddd            t        t        ddd      t        ddd                  t        ddd      gk(  sJ t	        |t        t        ddd      t        ddd                  t        t        ddd      t        ddd            gk(  sJ t	        ||      |gk(  sJ t        t        ddd      t        ddd            j	                  t        t        ddd      t        ddd                  t        ddd      gk(  sJ t        dd      j	                  t        dd	            t        ddd      gk(  sJ t        d
t        t        f      j	                  t        dt        t        f            t        t        t              gk(  sJ t        t        ddd      t        ddd            j	                  t        t        ddd      t        ddd                  g k(  sJ y )Nr   r6   r4   rR   r<   r8   r   )r   r<   r4   r   rZ   r   )r   r   r   r   r   r,   r   r.   )r~   r   rv   rw   r   r   r   s          r@   test_intersection_3dr  [  s   	Aq	B	Aq	B	BB	1a '!Q"2	3B	wq!QAq!1	2B	wq!QAq!1	2B	71a#WQ1%5	6BBB4'''GBB23r999B,,R01fWQ1=MwWXZ[]^O_6`5aaaaBB4'''BB4'''BB4'''E'!Q"2GBB4GHIgVWYZ\]N^M____IgaA&61a8HIJ'!Q"GAq!$45O7 7 7 7gaA.Aq0ABE'RSUVXYJZ\cdegikl\mDnoq!Q ! ! !E'!Q"2GAq!4DEFgaA&1a(89:; ; ;BB4''''!Q"GAq!$45BB6'RSUVXYJZ\cdeghjk\lCmnAq!  )Y'44VIy5QRW^_`bcefWgVhhhh&1a&!..vfq!f/EFAqM?   Aq!71a#34AA%PQSTVWHXZabcegijZkBlmqssssrC   c                  B   t        ddd      } t        ddd      }t        t        t        t              }t        t        t        t              t        t        t                    }t        t        t        t              t        t        dt        z               }t        j
                  t        t        dd      t        dd            |      sJ t        j
                  |t        t        t        t              t        t        dt        z                     du sJ t        j
                  ||j                  t        t         t                          sJ t        j
                  ||j                  t        dd                  sJ t        | |      j                  t        | |            sJ t        t        ddd      t        ddd            j                  t        t        ddd      t        ddd                  du sJ t        | |      j                  |      t        t        t        t        t              t        t        dz   t        dz   t        dz               k(  sJ t        | |      j                  |j                        t        t        t        t        t              t        t        dz   t        dz   t        dz               k(  sJ t        t        ddd      t        ddd            j                  t        t        ddd      t        ddd                  du sJ y )Nr   r6   FrR   )	r   r,   r   r   r-   is_parallelr   r   r   )r~   r   r   rw   l2_1s        r@   test_is_parallelr
    sw   	Aq	B	Aq	B	R	B	eBmU2r]	+Bb"uRR01DDq!eAqk:B???BU2r]E"a"f4E FG5PPPB 0 0sB @AAAD$"4"4U1a["ABBB"b>%%fRn555'!Q"GAq!$45AA&QRTUWXIY[bcdfgij[kBlmqvvvv"b>''+vgb"b6I6=b1fb1fbSTf6U0W W W W"b>''0'"b"%wrAvrAvrAv'FGH H H'!Q"GAq!$45AA&QRTUWXIY[bcdfgij[kBlmqvvvvrC   c                     t        dd      } t        dd      }t        | |      }t        t        t        t              t        t        t                    }t        | t        t         t                    }t        j                  ||      sJ t        j                  ||      du sJ |j                         }|j                  |      |k(  sJ t        j                  t        t        ddd      t        ddd            t        t        ddd      t        ddd                  du sJ t        j                  t        t        ddd      t        ddd            t        t        ddd      t        ddd                  du sJ t        j                  t        t        ddd      t        ddd            t        t        t        t        t              t        t        t        t                          du sJ y r}   )	r   r   r,   r-   is_perpendicularr   rq   r   r   )r~   r   rv   rw   l1_1r   s         r@   test_is_perpendicularr    s   	q!B	q!B	b"B	eBmU2r]	+BE2#rN#D  T***  R(E111
A##A&!+++""6'!Q*:GAq!<L#M#)'!Q*:GAq!<L#MORVW W W""6'!Q*:GAq!<L#M#)'!Q*:GAq!<L#MORWX X X""6'!Q*:GAq!<L#M#)'"b"*=wr2r?R#SUX]^ ^ ^rC   c            
      (   t        dd      } | j                  dd      }t        t        ddd      t        ddd            }t	        t        dd      t        dd            }t        t        dd      |       }|j                  t        | |            sJ |j                  |      du sJ |j                  t        t        ddd      t        ddd                  du sJ |j                  t        t        ddd      t        ddd                  du sJ y )Nr   r<   r6   r   FT)r   r   r   r   r   r   
is_similarr   )r~   r   r   r   r   s        r@   test_is_similarr    s    	tT	B	!QB	wq!QAq!1	2B	U1a[%1+	&B	q!b	!B==R)))==%%%==1a 0'!Q2BCDLLL==1a 0'!Q2BCDMMMrC   c                     t        t        t        t        t              t        t        t        t                    } t	        t        dd      t        dd            j                  t        u sJ | j                  t        d      t        t        t        z
  dz        z  k(  sJ t        t        ddd      t        ddd            j                  t        u sJ y )Nr   r6   r4   r<   )
r   r   r,   r-   r   r   rt   r   r   r   )r   s    r@   test_lengthr    s    	72r2&B(;	<BaU1a[)00B66699Q$RA~"66666'!Q"GAq!$45<<BBBrC   c                     t        dd      } t        ddd      }t        t         t              }t        | t        dd            }t	        t        ddd      t        ddd            }t	        |t        ddd            }t        t        dd      t        dd            }t        t        dd      t        dd            }t        t        dd      t        dd            }t        t        t        t              t        t        t                    j                  t        t        t                    t        t        t              k(  sJ t        t        t        t              t        t        dt        z               j                  t        dd            t        t        d      k(  sJ t        t        dd      t        dd            j                  |      t        t        dd      t        dd            k(  sJ t        t        dd      t        dd            j                  |      t        t        dd      t        dd            k(  sJ |j                  |      t        k(  sJ |j                  |      | k(  sJ |j                  t        | t        dd	                  t        t        dd      t        dd            k(  sJ |j                  t        | t        dd                  | k(  sJ |j                  t        t        dd      t        dd                  t        dd      k(  sJ |j                  t        t        dd      t        dd
                  t        t        dd      t        dd            k(  sJ |j                  t        t        dd	      t        d
d                  t        t        dd      t        dd            k(  sJ |j                  t        t        dd      t        dd                  t        dd      k(  sJ |j                  t        t        dd      t        dd
                  t        t        dd      t        dd            k(  sJ |j                  t        t        dd	      t        d
d                  t        t        dd      t        dd            k(  sJ |j                  t        |t        dd	d                  t        t        ddd      t        t        dd      t        dd      t        dd                  k(  sJ |j                  t        |t        ddd                  t        t        ddd      t        t        dd      t        dd      t        dd                  k(  sJ |j                  t        d	d	d            t        d	d      k(  sJ |j                  t	        t        ddd      t        ddd                  j                  |      sJ y )Nr   r6   r<   r   r   rR   r8   r4   r7   r   r   )r   r   r,   r   r   r   r   r   r-   r   r   r   r   r   )	r~   r   r   rv   rw   r   r   r   r   s	            r@   test_projectionr    s   	q!B	Aq	B	sBB	b%1+	B	1a '!Q"2	3B	GAq!$	%B	U1a[%1+	&B	A1	.B	A3	0Bb"uR}-88r2G5QSUW=XXXb"uRR01<<U1a[IUSUWX\YYY5Q<q!-88<bRSV[\]_`Va@bbbb5A;b!-88<aQRUZ[]_`Ua@bbbb==(((=="""==Rr1./3uQ{E!QK3PPPP==Rr1./2555==U1a[%B-89U1a[HHH==U1a[%B-89WU1a[RWXY[\R]=^^^^==r1uR~>?75QRTU;X]^_abXcCdddd==U1a[%B-89U1a[HHH==U1a[%B-89WU1a[RWXY[\R]=^^^^==r1uR~>?75QRTU;X]^_abXcCdddd==r72q!#456%1a@PRYZbcdfgZhjrstvwjx  {C  DE  GH  {I  SJ  ;K  K  K  K==r72q!#456%1a@PRYZbcdfgZhjrstvwjx  {C  DE  GH  {I  SJ  ;K  K  K  K==Aq)*gam;;;==1a 0'!Q2BCDKKBOOOrC   c                     t        ddd      t        ddd      t        ddd      }}} t        | |      }|j                  |      }|j                  |k(  sJ |j                  |v sJ t        dd      t        dd      t        dd      }}} t        | |      }|j                  |      }|j                  |k(  sJ |j
                  j                  ||j                  |      z
  j                  k(  sJ y )Nr   r<   r4   rR   r   )r   r   r   r~   r   	directionunitr   )r~   r   r   r   r   s        r@   test_perpendicular_liner    s    q!Qq!Qr1aBBRA	R A442::44199q!eAqk5Q<BBRA	R A442::;;Q\\"%5 5;;;;;rC   c            
         t        t        dd      t        dd            } t        t        t        j                  t        j                        t        t        dd      t        dd                  }t        t        t        j                  t        j                        t        t        dd      t        dd                  j                  }| j                         j                  |      sJ | j                  |      j                  t        | j                  |            sJ | j                  |dz         j                  |      sJ y )Nr   r6   r4   r<   r8   r   )	r   r   r   r   rs   r   rr   perpendicular_bisectorr   )r   alineon_lines      r@   test_perpendicular_bisectorr    s    	q!eAqk	*Bqvvqvv&hq!nhr1o(NOEeAFFAFF+U8Aq>8BPQ?-ST]]G$$&--e444$$W-44WR[['5RSSS$$Wv%56==eDDDrC   c                     t        dd      \  } t        df| df      t        t        d        t        t        d        t        t
        fd       t        t        d        t        t        d	        t        t        d
        t        t        d        t        t        d        t        t        d        y )Nr/   Tr'   r   c                      t        dd      S Nrg   r6   r?   rp   rC   r@   rA   ztest_raises.<locals>.<lambda>   s    d61o rC   c                  B    t        t        dd      t        dd            S Nr   )r   r   rp   rC   r@   rA   ztest_raises.<locals>.<lambda>  s    tE!QKq!= rC   c                  &    t        d z  d      v S )Nr<   r   )r   )dss   r@   rA   ztest_raises.<locals>.<lambda>  s    a!eQ1 4 rC   c                  ,    t        t        dd            S )Nr   )r   r   rp   rC   r@   rA   ztest_raises.<locals>.<lambda>  s    uU3_5 rC   c                  F    t        t        ddd      t        ddd            S r#  r   r   rp   rC   r@   rA   ztest_raises.<locals>.<lambda>  s    vgaA&61a8HI rC   c                      t        dd      S r!  )r   rp   rC   r@   rA   ztest_raises.<locals>.<lambda>  s    fVQ/ rC   c                  .    t        t        ddd            S r#  r)  rp   rC   r@   rA   ztest_raises.<locals>.<lambda>  s    vgaA&67 rC   c                      t        dd      S r!  )r   rp   rC   r@   rA   ztest_raises.<locals>.<lambda>  s    c&!n rC   c                      t        t        dd      t        dd            j                  t        t        dd      d            S )Nr   r6   )r   r   r   r   rp   rC   r@   rA   ztest_raises.<locals>.<lambda>  s3    $uQ{E!QK"@JveAqk1-. rC   )r
   r   r$   	TypeErrorrL   r!   r   )er%  r&  s    @@r@   test_raisesr0    s    5t$DAqAAA
9-.
:=>
;45
:56
:IJ
9/0
:78
9,-
= / 0rC   c                     t        dt        dz        t        dd      k(  sJ t        dt        dz        t        dd      k(  sJ t        dt         dz        t        dd      k(  sJ t        ddt        z  dz        t        dd      k(  sJ t        dd	t        z  dz        t        dd      k(  sJ t        dd
t        z  dz        t        dd      k(  sJ t        dt              t        dd      k(  sJ t        ddt        z        t        dd      k(  sJ t        ddt        z        t        dd      k(  sJ t        dd      t        dd      k(  sJ t        ddt        z        t        t        dd      t        dt        d	       t        dt        d	      z  dz         z  dz  t        dt        d	      z  dz         dz  z
  dz   t        d	      z               k(  sJ t        ddt        z        t        t        dd      t        ddt	        dt        z        z               k(  sJ t        dd	      t        dddt	        d	      z   f      k(  sJ t        dg d      t        t        ddd      t        d	d	d	            k(  sJ t        dg d      t        t        ddd      t        ddd            k(  sJ t        dg d      t        t        ddd      t        ddd            k(  sJ y )Nrg   rR   r[   r   r<   r]   r   r;   r7   g      @r   g      @g      @)r<   r6   r   g333333@r6   r   gGz@ri   )rR   rR   rR   rk   rj   r4   )r   r   r   r   r   r   r   rp   rC   r@   test_ray_generationr2    s   vR!V$FF(;;;;vR!V$FF(;;;;vbS1W%VV)<<<<vR"Wq[)S-@@@@vQVaZ(C,????vS2X\*c&&.AAAAvR C$7777vS2X&#ff*====vS2X&#ff*====vQ3vv#6666vTBY'3uQ{/4Qa4DQRGVXHXCY8Y\]8]`d34tAw;3CaEGHaI 9IKL9MOSTUw9W 0X,Y Y Y Y vTBY'3uQ{/4QCr	N8J/K,M M M MvQ3v1s1v:#????I6%1a@PRYZ[]^`aRb:ccccI6%1a@PRYZ[]^`aRb:ccccI6%1a@PRYZ[]^`aRb:ccccrC   c                  J   t        t        t        d      t              } t	        t        t
        t              d      }t        t        t        z
  t        t        z   z        }|j                  |       t        t        |z   t              t        t        |z
  t              gk(  sJ y )Nr   r   )
r   r   r&   r)   r   r+   r*   r   r   r   )circleline_ss      r@   test_issue_7814r7  #  sp    E!QK#Fa1%D	q1uq1uo	BV$R);WQVQ=O(PPPPrC   c                  V    fd} d\  d\   |         d\   |         y )Nc                      t        t        t        t        fgdz   D ]<  \  } } |       } |      }|j	                  |      |j	                  |      k(  r<J  y )Nr<   )r#   r   r   r   r   )fgrv   rw   r2   r3   cr%  s       r@   _checkztest_issue_2941.<locals>._check+  s`    dC12Q67 	>DAq1aB1aB??2&"//"*====	>rC   ))r   r   r   )rZ   rg   ))r   r;   r   rp   )r=  r2   r3   r<  r%  s    @@@@r@   test_issue_2941r>  *  s/    > DAqDAq
HDAq
HrC   c                      t        d      t        dd      t        dd      }} t        | |      j                  d      dik(  sJ t	        t
        fd       y )Nr.   r   r6   r7   r   )r7   r   c                  (     j                  d      S )NrZ   )parameter_value)r   r.   s   r@   rA   z&test_parameter_value.<locals>.<lambda>>  s    q00; rC   )r	   r   r   rA  r$   rL   )r~   r   r   r.   s     @@r@   test_parameter_valuerB  9  sV    sA1a[%1+BRAVQ'Aq6111
:;<rC   c            
      P   t        t        ddd      t        ddd            } t        t        ddd      t        ddd            }| j                  |      }|t        t        ddd      t        ddd            t        t        ddd      t        ddd            gk(  sJ t        t        ddd      t        ddd            t        t        ddd      t        ddd            g}d}d}t        t        t
        t        fd      D ]!  \  }} || j                   ||       |k(  r!J  y )Nr   r6   r8   )r   r   )rZ   r   r<   )repeat)r   r   	bisectorsr#   r   r   r   )r   r   
bisectionsansrv   rw   r2   r3   s           r@   test_bisectorsrH  A  s%   	1a '!Q"2	3B	1a '!Q"2	3Bb!J&Aq!171a3CDwq!QB!235 5 5 5'!Q"GAq!$45wq!QQ!235C	B	Bgs+A6 /1"v2'3.../rC   c                      t        t        ddd      t        ddd            } t        t        ddd      t        ddd            }| j                  |      t        ddd      gk(  sJ y )Nr   r7   r   ir8   gffffff?)r   r   r   rF   s     r@   test_issue_8615rJ  O  sa    wq!QB!23Awq"e$gaQ&78A>>!B!2 3333rC   c                     t        t        dd      t        dd      j                  d            } t        t        dd      t        dd      j                  d            }t        | j	                  |      d         dk(  sJ t        dd	      }t        d
d      j                  d      }t        |j	                  |      d         dk(  sJ t        d
d      j                  d      }|j	                  |      rJ y )Nr   r6   g\(\?gHzG?r<   gQ?zPoint2D(0.82, 0.82)rZ   rg   r   r   zPoint2D(-0.33, -0.33))g      r   )r   r   nstrr   r   r   )r   r   rv   rw   s       r@   test_issue_12598rN  U  s    	U1a[%d+--a0	1B	U1a[%d+--a0	1Brr"1%&*????	ff	B	'	"	$	$Q	'Brr"1%&*AAAA	+	&	(	(	+Br""""rC   N)`sympy.core.numbersr   r   r   r   sympy.core.relationalr   sympy.core.singletonr   sympy.core.symbolr	   r
   (sympy.functions.elementary.miscellaneousr   (sympy.functions.elementary.trigonometricr   r   r   
sympy.setsr   sympy.simplify.simplifyr   r   sympy.geometryr   r   r   r   r   r   r   r   r   r   r   r   r   r   r    sympy.geometry.liner!   sympy.geometry.polygonr"   r   r   r#   sympy.testing.pytestr$   r%   r&   r)   r*   r+   r,   r-   r.   r2   r3   r0   rM   rP   rX   r_   rb   re   rx   r{   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r
  r  r  r  r  r  r  r0  r2  r7  r>  rB  rH  rJ  rN  rp   rC   r@   <module>r[     s   8 8 $ " / 9 E E  , 8     , . , . 3T
3T
3T
3TDtDt
3Tu4 1Cd50&S#<CJ$S	B""JJCZ*IZ'5T#:C
-T`I4'DMATO!tHw*^*NC PF< E0 d.Q=/4#rC   