Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.145.99.84
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : planet_and_moon.cpython-310.pyc
o

_b	�@sddZddlmZmZmZmZdZGdd�de�Z	Gdd�de�Z
dd	�Zed
kr0e�e�dSdS)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�C/usr/local/python-3.10/lib/python3.10/turtledemo/planet_and_moon.py�__init__s
zGravSys.__init__cCs|jD]}|��qdS)N)r�init)r�prrr
rs

�zGravSys.initcCs6td�D]}|j|j7_|jD]}|��qqdS)Ni')�ranger	r
r�step)r�irrrr
�start s

��z
GravSys.startN)�__name__�
__module__�__qualname__rrrrrrr
rsrc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�StarcCsTtj||d�|��||_|�|�||_|j�|�||_|�	d�|�
�dS)N)�shape�user)rrZpenup�m�setpos�vr�append�gravSysZ
resizemodeZpendown)rr�xrrrrrr
r's

z
Star.__init__cCs,|jj}|��|_|jd||j|_dS)N��?)rr
�acc�ar�rr
rrr
r1s
z	Star.initcCsRtdd�}|jjD]}||kr&|��|��}|t|jt|�d|7}q	|S)Nr�)�Vecrr�pos�Gr�abs)rr#�planetrrrr
r"5s
�zStar.acccCsj|jj}|�|��||j�|jj�|�dkr%|�|�|jjd��|�	�|_
|j||j
|_dS)Nr)rr
rr'rr�indexZ
setheadingZtowardsr"r#r$rrr
r<s
z	Star.stepN)rrrrrr"rrrrr
r&s

rcCs|t�}|��|���dd�|��|��|�d�|�d�|��|�	dd�|�
�|��}|��|�	dd�|�
�|��}td�}|�
|d�|�
|d�|���d|�|���d	d�t�}td
tdd�tdd�|d�}|�d
�|�d�|��tdtdd�tdd�|d�}|�d�|�d�td	tdd�tdd�|d�}|�d�|�d�|��|��dS)Nr��Z�ZcompoundZorangeZbluer*�i@Bg��circleZyellowg������?i�0����Zgreeng�������?��i'r!zDone!)r�resetZ	getscreenZtracerZhtZpu�fd�ltZ
begin_polyr0Zend_polyZget_polyrZaddcomponentZregister_shaperrr&ZcolorZ	shapesizeZpencolorrr)�sZm1Zm2ZplanetshapeZgsZsunZearthZmoonrrr
�mainFsD







r8�__main__N)
�__doc__Zturtlerrrrr&r(�objectrrr8rrrrr
�<module>s '
�
© 2025 GrazzMean