-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
48 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
使用turtle模块的太阳系模拟程序 | ||
使用tkinter以及turtle模块的太阳系模拟程序。 | ||
快捷键: | ||
按Ctrl+“+”或Ctrl+“-”进行缩放。 | ||
|
@@ -27,7 +27,7 @@ | |
except ImportError: | ||
from Tkinter import TclError # Python 2 | ||
|
||
__author__="七分诚意 qq:3076711200" | ||
__author__="qfcy qq:3076711200" | ||
__email__="[email protected]" | ||
__version__="1.3.3" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
from random import randrange | ||
from turtle import Shape, Turtle, update, Screen, Terminator, Vec2D as Vec, mainloop | ||
|
||
__author__="七分诚意 qq:3076711200" | ||
__author__="qfcy qq:3076711200" | ||
__email__="[email protected]" | ||
__version__="1.0.3" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
except ImportError: | ||
from Tkinter import TclError | ||
|
||
__author__="七分诚意 qq:3076711200" | ||
__author__="qfcy qq:3076711200" | ||
__email__="[email protected]" | ||
__version__="1.1.1" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
except ImportError: | ||
from Tkinter import TclError | ||
|
||
__author__="七分诚意 qq:3076711200" | ||
__author__="qfcy qq:3076711200" | ||
__email__="[email protected]" | ||
__version__="1.2.04" | ||
|
||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@echo off | ||
pyinstaller "solar_system\싱야경\多제친콰 - 뒤寧、랗倒壟醵똑.py" -i solar_system\dist\暠깃.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm | ||
pyinstaller "solar_system\싱야경\多제친콰 - 역팹잇뒤寧땍쪼.py" -i solar_system\dist\暠깃.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm | ||
pyinstaller "solar_system\싱야경\多제친콰 - 역팹잇뒤랗땍쪼.py" -i solar_system\dist\暠깃.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm | ||
pyinstaller "solar_system\싱야경\多제친콰 - 역팹잇뒤힛땍쪼.py" -i solar_system\dist\暠깃.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm | ||
pyinstaller "solar_system\싱야경\多제친콰 - 휑뒈墩.py" -i solar_system\dist\暠깃.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm | ||
pyinstaller "solar_system\싱야경\多제친콰 - 格捺溝.py" -i solar_system\dist\暠깃.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm | ||
pyinstaller "solar_system\싱야경\多제친콰 - 括槿긴뱀.py" -i solar_system\dist\暠깃.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm | ||
pyinstaller "solar_system\ENG\cosmic_velocities.py" -i solar_system\ENG\dist\icon.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm | ||
pyinstaller "solar_system\ENG\kepler_1st.py" -i solar_system\ENG\dist\icon.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm | ||
pyinstaller "solar_system\ENG\kepler_2nd.py" -i solar_system\ENG\dist\icon.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm | ||
pyinstaller "solar_system\ENG\kepler_3rd.py" -i solar_system\ENG\dist\icon.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm | ||
pyinstaller "solar_system\ENG\satellite_orbit_change.py" -i solar_system\ENG\dist\icon.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm | ||
pyinstaller "solar_system\ENG\solar_system_with_controls.py" -i solar_system\ENG\dist\icon.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm | ||
pyinstaller "solar_system\ENG\sun_earth_moon.py" -i solar_system\ENG\dist\icon.ico -w --hidden-import tkinter.simpledialog --exclude-module solar_system --exclude-module turtle --noconfirm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ Name: solar-system | |
Version: 1.3.3 | ||
Summary: Python模拟万有引力、太阳系行星运动的库,模拟天体轨道,验证开普勒三大定律。Computer simulation of gravity and planetary motion in the solar system,emulating the orbits of celestial bodies and verifying Kepler's three laws. | ||
Home-page: https://github.com/qfcy/python-gravity-simulation | ||
Author: 七分诚意 qq:3076711200 | ||
Author: qfcy qq:3076711200 | ||
Author-email: [email protected] | ||
Keywords: solar,system,solarsys,turtle,graphics,astronomy,gravity,physics,太阳系,引力,模拟,物理,天文,mercury,venus,earth,mars,jupiter,saturn,uranus,neptune,pluto | ||
Classifier: Programming Language :: Python | ||
|
@@ -36,7 +36,7 @@ Increase the distance from the moon to the earth continuously. The moon will be | |
|
||
支持跟踪行星、切换行星,包含简单的发射“飞船”功能。 | ||
|
||
图形部分使用turtle(tkinter)或Pygame库。 | ||
图形部分使用tkinter(turtle)或Pygame库。 | ||
|
||
你能在其中创造一个属于自己的宇宙。 | ||
|
||
|
@@ -58,6 +58,8 @@ You’re able to create a universe belonging to yourself in this program. Additi | |
一.各个文件的介绍 | ||
================= | ||
|
||
源代码位于solar_system目录中。 | ||
|
||
1.主程序 | ||
-------- | ||
|
||
|
@@ -164,9 +166,9 @@ y\ :sub:`B`\ \| /md。 | |
四.常见问题 | ||
=========== | ||
|
||
Q: 为什么本项目主要使用了turtle库,而不用其他更高级的图形库? | ||
Q: 为什么本项目使用了turtle库渲染tkinter.Canvas的界面,而不直接使用tkinter,或其他图形库? | ||
|
||
A: 首先,作者本想用tkinter库编写该程序,但考虑到直接调用Canvas控件绘制行星形状的代码量较大,而且由于基于tkinter的turtle库封装了tkinter,能够间接调用Canvas控件进行绘图,就使用turtle库绘制图形。 | ||
A: 首先,作者本想用tkinter库编写该程序,但考虑到直接调用Canvas控件绘制行星形状的代码量较大,而且基于tkinter的turtle库封装了tkinter,能够间接调用Canvas控件进行绘图,就使用turtle库绘制图形,避免重复造轮子。 | ||
|
||
目前,程序中的界面主要使用tkinter库设计,而基于tkinter的turtle库仅用于渲染。另外,作者基于自己的tkinter知识,重写和扩展了原版turtle模块,如`TESTS\solar_system_blackhole2.py`基于PIL库为turtle添加了图像旋转功能。 | ||
|
||
|
@@ -190,6 +192,8 @@ bilibili主页:\ `qfcy\_ <https://space.bilibili.com/454233262>`__ | |
1.The introduction to each file | ||
=============================== | ||
|
||
The source code is located in the solar_system directory. | ||
|
||
(1) Main program | ||
---------------- | ||
|
||
|
@@ -300,9 +304,9 @@ However, there are application materials for award-winning works in the reposito | |
4.Q&A | ||
===== | ||
|
||
Q: Why does this project primarily use the turtle library instead of other more advanced graphics libraries? | ||
Q: Why does this project utilize turtle to render the tkinter.Canvas interface instead of using tkinter directly or other graphics libraries? | ||
|
||
A: Initially, I intended to use the tkinter library to write the program, but considering the substantial amount of code required to directly manipulate the Canvas widget for drawing planetary shapes, while the turtle module based on tkinter encapsulates many tkinter functions and can indirectly invoke the Canvas widget for drawing, the turtle library was chosen for rendering graphics. Currently, the program's interface is mainly designed using the tkinter library, while the turtle library, which is based on tkinter, is only used for rendering. Additionally, I has rewritten and extended the original turtle module based on their knowledge of tkinter, such as adding image rotation functionality to turtle using the PIL library in `TESTS\\solar\_system\_blackhole2.py`. Furthermore, using the turtle library reduces the amount of code needed for graphic rendering, allowing the main focus to be on designing the physics algorithms and developing other features. | ||
A: Initially, I intended to use the tkinter module to write the program, but considering the substantial amount of code required to directly manipulate the Canvas widget for drawing planetary shapes, while the turtle module based on tkinter encapsulates many tkinter functions and can indirectly invoke the Canvas widget for drawing, the turtle module was chosen for rendering to avoid reinventing wheels. Currently, the program's interface is mainly designed using the tkinter module, while the turtle module, which is based on tkinter, is only used for rendering. Additionally, I has rewritten and extended the original turtle module based on their knowledge of tkinter, such as adding image rotation functionality to turtle using the PIL library in `TESTS\\solar\_system\_blackhole2.py`. Furthermore, using the turtle module reduces the amount of code needed for graphic rendering, allowing the main focus to be on designing the physics algorithms and developing other features. | ||
|
||
Q: What are the known factors contributing to the precision loss in calculations? | ||
|
||
|
Binary file modified
BIN
-2.13 MB
(94%)
solar_system/ENG/dist/Python-gravity-simulation-portable.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.