diff --git a/README.md b/README.md index d8dce6eb89234d2883bb5b0f9606cea4773c3aaf..27f45307bb3c695c08df51851506acd92e5f7b35 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,11 @@ 我们可以自己通过调整天体的初始坐标、质量和矢量速度等等参数来自定义各种场景来控制天体的运行效果。 +# 效果图 + + + + # 抖音课堂: diff --git a/images/solar_system_1.png b/images/solar_system_1.png new file mode 100644 index 0000000000000000000000000000000000000000..f1509baeefda2a6ea0b638d5b42c833e82e06b02 Binary files /dev/null and b/images/solar_system_1.png differ diff --git a/images/solar_system_2.png b/images/solar_system_2.png new file mode 100644 index 0000000000000000000000000000000000000000..0a051910f0b691216490617cefaf81b00f455d5c Binary files /dev/null and b/images/solar_system_2.png differ diff --git a/images/three_body_1.png b/images/three_body_1.png new file mode 100644 index 0000000000000000000000000000000000000000..4f797c7f03d29cef2228e55b8523a8754d240e37 Binary files /dev/null and b/images/three_body_1.png differ diff --git a/images/three_body_2.png b/images/three_body_2.png new file mode 100644 index 0000000000000000000000000000000000000000..9de4f80bbd0b80e9a19db148bcdd903e0b6f9d95 Binary files /dev/null and b/images/three_body_2.png differ diff --git a/scenes/two_body_01.py b/scenes/two_body_01.py new file mode 100644 index 0000000000000000000000000000000000000000..8835eb53c0e13be343f43658d0d25bfaf2b5d92f --- /dev/null +++ b/scenes/two_body_01.py @@ -0,0 +1,30 @@ +# -*- coding:utf-8 -*- +# title :三体场景模拟01 +# description :三体场景模拟(2个太阳、1个地球) +# author :Python超人 +# date :2023-02-11 +# link :https://gitcode.net/pythoncr/ +# python_version :3.8 +# ============================================================================== +from mayavi import mlab +from bodies import Sun, Earth +from common.consts import SECONDS_PER_WEEK +from scenes.func import mayavi_run + +if __name__ == '__main__': + """ + 2个太阳、1个地球(效果1) + 可以修改影响效果的参数为: + 1、三个方向的初始位置 init_position[x, y, z] + 2、三个方向的初始速度 init_velocity[x, y, z] + 3、天体质量 mass + """ + bodies = [ + Sun(mass=1.5e30, init_position=[849597870.700, 0, 0], init_velocity=[0, 7.0, 0], + size_scale=5e1, texture="sun1.jpg"), # 太阳放大 100 倍 + Sun(mass=2e30, init_position=[0, 0, 0], init_velocity=[0, -8.0, 0], + size_scale=5e1, texture="sun2.jpg"), # 太阳放大 100 倍 + Earth(init_position=[0, 349597870.700, 0], init_velocity=[10.50, 0, 0], + size_scale=4e3, distance_scale=1), # 地球放大 4000 倍,距离保持不变 + ] + mayavi_run(bodies, SECONDS_PER_WEEK, view_azimuth=0)