Sindbad~EG File Manager

Current Path : /usr/lib64/python3.6/turtledemo/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/turtledemo/__pycache__/planet_and_moon.cpython-36.pyc

3


 \�@s`dZddlmZmZmZmZdZGdd�de�Z	Gdd�de�Z
dd	�Zed
kr\e�e�dS)a�       turtle-example-suite:

        tdemo_planets_and_moon.py

Gravitational system simulation using the
approximation method from Feynman-lectures,
p.9-8, using turtlegraphics.

Example: heavy central body, light planet,
very light moon!
Planet has a circular orbit, moon a stable
orbit around the planet.

You can hold the movement temporarily by
pressing the left mouse button with the
mouse over the scrollbar of the canvas.

�)�Shape�Turtle�mainloop�Vec2D�c@s$eZdZdd�Zdd�Zdd�ZdS)�GravSyscCsg|_d|_d|_dS)Nrg{�G�z�?)�planets�t�dt)�self�r�2/usr/lib64/python3.6/turtledemo/planet_and_moon.py�__init__szGravSys.__init__cCsx|jD]}|j�qWdS)N)r�init)r�prrr
rszGravSys.initcCs>x8td�D],}|j|j7_x|jD]}|j�q&Wq
WdS)Ni')�ranger	r
r�step)r�irrrr
�start sz
GravSys.startN)�__name__�
__module__�__qualname__rrrrrrr
rsrc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�StarcCsTtj||d�|j�||_|j|�||_|jj|�||_|j	d�|j
�dS)N)�shape�user)rrZpenup�m�setpos�vr�append�gravSysZ
resizemodeZpendown)rr�xrrrrrr
r's

z
Star.__init__cCs,|jj}|j�|_|jd||j|_dS)Ng�?)rr
�acc�ar)rr
rrr
r1s
z	Star.initcCsVtdd�}xF|jjD]:}||kr|j�|j�}|t|jt|�d|7}qW|S)Nr�)�Vecrr�pos�Gr�abs)rr"�planetrrrr
r!5s
"zStar.acccCsj|jj}|j|j�||j�|jjj|�dkrJ|j|j|jjd��|j	�|_
|j||j
|_dS)Nr)rr
rr%rr�indexZ
setheadingZtowardsr!r")rr
rrr
r<s
z	Star.stepN)rrrrrr!rrrrr
r&s
rcCs|t�}|j�|j�jdd�|j�|j�|jd�|jd�|j�|j	dd�|j
�|j�}|j�|j	dd�|j
�|j�}td�}|j
|d�|j
|d�|j�jd|�|j�jd	d�t�}td
tdd�tdd�|d�}|jd
�|jd�|j�tdtdd�tdd�|d�}|jd�|jd�td	tdd�tdd�|d�}|jd�|jd�|j�|j�dS)Nr��Z�ZcompoundZorangeZbluer(�i@Bg@�circleZyellowg������?i�0����Zgreeng�������?��i'g�?zDone!g�)r�resetZ	getscreenZtracerZhtZpu�fd�ltZ
begin_polyr.Zend_polyZget_polyrZaddcomponentZregister_shaperrr$ZcolorZ	shapesizeZpencolorrr)�s�m1�m2ZplanetshapeZgsZsunZearthZmoonrrr
�mainFsD







r8�__main__N)
�__doc__Zturtlerrrrr$r&�objectrrr8rrrrr
�<module>s '

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists