???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
Afc           @   s  d  Z  d d l Td d l m Z m Z d d l m Z m Z d d Z d	 e d
 e d ƒ Z	 d „  Z
 d „  Z d „  Z d „  Z d	 d „ Z d „  Z d „  Z d „  Z d „  Z d d e d d	 d „ Z e d „ Z d „  Z e d k rþ e ƒ  Z e ƒ  n  d S(    sŽ         xturtle-example-suite:

          xtx_kites_and_darts.py

Constructs two aperiodic penrose-tilings,
consisting of kites and darts, by the method
of inflation in six steps.

Starting points are the patterns "sun"
consisting of five kites and "star"
consisting of five darts.

For more information see:
 http://en.wikipedia.org/wiki/Penrose_tiling
 -------------------------------------------
iÿÿÿÿ(   t   *(   t   cost   pi(   t   clockt   sleepi   g      à?i   g       @i   i   i
   c         C   sh   t  |  } t d ƒ t |  ƒ t d ƒ t | ƒ t d ƒ t | ƒ t d ƒ t |  ƒ t d ƒ d  S(   Ni$   il   i   (   t   ft   ltt   fdt   rt(   t   lt   fl(    (    s1   /usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt   kite   s    








c         C   sh   t  |  } t d ƒ t |  ƒ t d ƒ t | ƒ t d ƒ t | ƒ t d ƒ t |  ƒ t d ƒ d  S(   Ni$   i   (   R   R   R   R   (   R	   R
   (    (    s1   /usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt   dart%   s    








c         C   s  | d k ra t  ƒ  \ } } t t ƒ  ƒ t | d ƒ t | d ƒ } } } t t | | | f <d  St |  } t d ƒ t | | d ƒ t	 |  ƒ t
 d ƒ t | | d ƒ t d ƒ t	 |  t ƒ t
 d ƒ t | | d ƒ t d ƒ t	 |  ƒ t
 d ƒ t | | d ƒ t d ƒ d  S(	   Ni    i   i$   i   i   i   i¢   i´   (   t   post   intt   headingt   roundt   Truet   tiledictR   R   t   inflatedartR   R   t   inflatekitet   d(   R	   t   nt   pxt   pyt   ht   xt   yR
   (    (    s1   /usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyR   1   s(    /








c         C   sö   | d k ra t  ƒ  \ } } t t ƒ  ƒ t | d ƒ t | d ƒ } } } t t | | | f <d  St |  } t | | d ƒ t d ƒ t	 |  ƒ t
 d ƒ t | | d ƒ t d ƒ t	 |  t ƒ t
 d ƒ t | | d ƒ t	 |  ƒ t
 d ƒ d  S(	   Ni    i   i   i$   i´   i6   i~   i   (   R   R   R   R   t   FalseR   R   R   R   R   R   R   R   (   R	   R   R   R   R   R   R   R
   (    (    s1   /usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyR   G   s"    /






c         C   sª   t  ƒ  |  t | }  t |  d |  d | ƒ xv t D]n } | \ } } } t | | ƒ t | ƒ t | r„ t d ƒ t d d ƒ n t d ƒ t d d ƒ t ƒ  q4 Wd  S(	   Ng      Y@R   t   blacki    g      è?R   (   i    g      è?i    (   g      è?i    i    (	   t   clearR   t	   shapesizeR   t   setpost
   setheadingt   shapet   colort   stamp(   R	   R   t   tht   kR   R   R   (    (    s1   /usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt   drawZ   s    



c         C   s2   x+ t  d ƒ D] } t |  | ƒ t d ƒ q Wd  S(   Ni   iH   (   t   rangeR   R   (   R	   R   t   i(    (    s1   /usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt   sunj   s    c         C   s2   x+ t  d ƒ D] } t |  | ƒ t d ƒ q Wd  S(   Ni   iH   (   R(   R   R   (   R	   R   R)   (    (    s1   /usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt   staro   s    c           C   sh   t  d ƒ t ƒ  t d ƒ t ƒ  t d t ƒ  ƒ t ƒ  t d ƒ t ƒ  t d t ƒ  ƒ t  d ƒ d  S(   Ni    id   R   R   i   (   t   tracert
   begin_polyR   t   end_polyt   register_shapet   get_polyR   (    (    (    s1   /usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt
   makeshapest   s    


c           C   s*   t  ƒ  t ƒ  t ƒ  t ƒ  t d ƒ d  S(   Nt   user(   t   resett   htt   puR1   t
   resizemode(    (    (    s1   /usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt   start€   s
    iÈ   i   i    c         C   sù   t  | ƒ t d ƒ i  a t ƒ  } t d ƒ | |  | ƒ t ƒ  } t |  | | ƒ t d ƒ t ƒ  } d | | GHd | | GHd | | GHt g  t D] } t | r— | ^ q— ƒ }	 t g  t D] } t | sÀ | ^ qÀ ƒ }
 d |	 |
 |	 |
 f GHd  S(   Ni    i   s   Calculation:   %7.4f ss   Drawing:  %7.4f ss   Together: %7.4f ss"   %d kites and %d darts = %d pieces.(   t   gotoR!   R   R   R,   R'   t   len(   R	   R   t   funt   startposR%   t   at   bt   cR   t   nkt   nd(    (    s1   /usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt   test‡   s     

	
	
	))c         C   sk   t  ƒ  x] t d ƒ D]O } t ƒ  } t d | |  ƒ t ƒ  } | | } | d k  r t d | ƒ q q Wd  S(   Ni   i,  i   (   R7   R(   R   RA   R   (   R:   R)   R<   R=   t   t(    (    s1   /usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt   demoš   s    		
c           C   sŒ   t  d ƒ t d d d ƒ t t ƒ t d ƒ t t ƒ t d ƒ t d d ƒ t d d d ƒ t d	 d
 d d d ƒt	 d d d d ƒd S(   Nt   logog333333Ó?i    i   R   i8ÿÿÿgffffffæ?i   s   Please wait...t   alignt   centert   fonts   Arial Blacki$   t   boldiX  i   R;   iF   iu   t   Done(   s   Arial Blacki$   RH   (   iF   iu   (
   t   modet   bgcolorRC   R*   R   R+   t   pencolorR8   t   writeRA   (    (    (    s1   /usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt   main¤   s    




	t   __main__Ng¨ô—›wã@gPé/7ïÆó?(   i    i    (   t   __doc__t   turtlet   mathR   R   t   timeR   R   R   R   R   R   R   R   R'   R*   R+   R1   R7   RA   RC   RN   t   __name__t   msgt   mainloop(    (    (    s1   /usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt   <module>   s(   

								
		