Your IP : 216.73.216.213


Current Path : /opt/alt/python33/lib64/python3.3/turtledemo/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/turtledemo/__pycache__/penrose.cpython-33.pyc

�
��f�
c@s"dZddlTddlmZmZddlmZmZd*Zd	ed
ed�Z	dd
�Z
dd�Zdd�Zdd�Z
d	dd�Zdd�Zdd�Zdd�Zdd�Zdded+d	d d!�Zed"d#�Zd$d%�Zed&kre�Ze�nd'S(,u�       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(u*(ucosupi(uclockusleepig�?ig@iii
cCsht|}td�t|�td�t|�td�t|�td�t|�td�dS(Ni$ili�(ufultufdurt(ulufl((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyukites








ukitecCsht|}td�t|�td�t|�td�t|�td�t|�td�dS(Ni$i�(ufultufdurt(ulufl((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyudart%s








udartcCs|dkrat�\}}tt��t|d�t|d�}}}d	t|||f<dSt|}td�t||d�t	|�t
d�t||d�td�t	|t�t
d�t||d�td�t	|�t
d�t||d�td�dS(
Niii$ii�ii�i�T(
uposuintuheadingurounduTrueutiledictufultuinflatedartufdurtuinflatekiteud(ulunupxupyuhuxuyufl((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyuinflatekite1s(/








uinflatekitecCs�|dkrat�\}}tt��t|d�t|d�}}}d	t|||f<dSt|}t||d�td�t	|�t
d�t||d�td�t	|t�t
d�t||d�t	|�t
d�dS(
Niiii$i�i6i~i�F(
uposuintuheadingurounduFalseutiledictufuinflatekiteultufdurtuinflatedartud(ulunupxupyuhuxuyufl((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyuinflatedartGs"/






uinflatedartcCs�t�|t|}t|d|d|�xvtD]n}|\}}}t||�t|�t|r�td�tdd�ntd�tdd�t�q4WdS(	NgY@ukiteublackig�?udart(ig�?i(g�?ii(	uclearufu	shapesizeutiledictusetposu
setheadingushapeucolorustamp(ulunuthukuhuxuy((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyudrawZs






udrawcCs2x+td�D]}t||�td�q
WdS(NiiH(urangeuinflatekiteult(ulunui((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyusunjs
usuncCs2x+td�D]}t||�td�q
WdS(NiiH(urangeuinflatedartult(ulunui((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyustaros
ustarcCshtd�t�td�t�tdt��t�td�t�tdt��td�dS(Niidukiteudarti(utraceru
begin_polyukiteuend_polyuregister_shapeuget_polyudart(((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyu
makeshapests


u
makeshapescCs*t�t�t�t�td�dS(Nuuser(uresetuhtupuu
makeshapesu
resizemode(((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyustart�s
ustarti�ic
Cs�t|�td�iat�}td�|||�t�}t|||�td�t�}td||�td||�td||�tdd�tD��}tdd�tD��}	td	||	||	f�dS(
NiiuCalculation:   %7.4f suDrawing:  %7.4f suTogether: %7.4f scSs g|]}t|r|�qS((utiledict(u.0ux((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyu
<listcomp>�s	utest.<locals>.<listcomp>cSs g|]}t|s|�qS((utiledict(u.0ux((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyu
<listcomp>�s	u"%d kites and %d darts = %d pieces.(ugotou
setheadingutiledictuclockutracerudrawuprintulen(
ulunufunustartposuthuaubucunkund((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyutest�s 

	

	
	utestcCskt�x]td�D]O}t�}td||�t�}||}|dkrtd|�qqWdS(Nii,i(ustarturangeuclockutestusleep(ufunuiuaubut((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyudemo�s		
udemocCs�td�tddd�tt�td�tt�td�tdd�tddd�td	d
ddd�t	dddd�dS(Nulogog333333�?iiublacki�gffffff�?iuPlease wait...ualignucenterufontuArial Blacki$uboldiXiustartposiFiuuDonei8���(uArial Blacki$ubold(iFiu(
umodeubgcolorudemousunusleepustarupencolorugotouwriteutest(((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyumain�s





	
umainu__main__Ng��w�@gP�/7���?gP�/7���?(ii(u__doc__uturtleumathucosupiutimeuclockusleepufudukiteudartuinflatekiteuinflatedartudrawusunustaru
makeshapesustartutestudemoumainu__name__umsgumainloop(((u7/opt/alt/python33/lib64/python3.3/turtledemo/penrose.pyu<module>s(