Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
太阳系三体模拟器
提交
b6ffb3a5
太阳系三体模拟器
项目概览
Python_超人
/
太阳系三体模拟器
通知
1103
Star
131
Fork
129
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
太阳系三体模拟器
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b6ffb3a5
编写于
3月 23, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
太阳系三体模拟器
上级
da43f624
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
47 addition
and
36 deletion
+47
-36
bodies/fixed_stars/antares.py
bodies/fixed_stars/antares.py
+2
-2
bodies/fixed_stars/betelgeuse.py
bodies/fixed_stars/betelgeuse.py
+2
-2
bodies/fixed_stars/eta_carinae.py
bodies/fixed_stars/eta_carinae.py
+1
-2
bodies/fixed_stars/pollux.py
bodies/fixed_stars/pollux.py
+1
-6
bodies/fixed_stars/procyon.py
bodies/fixed_stars/procyon.py
+1
-7
bodies/fixed_stars/rigel.py
bodies/fixed_stars/rigel.py
+1
-1
bodies/fixed_stars/vy_canis_majoris.py
bodies/fixed_stars/vy_canis_majoris.py
+5
-3
scenes/fixed_stars.py
scenes/fixed_stars.py
+11
-10
scenes/func.py
scenes/func.py
+2
-1
simulators/ursina_simulator.py
simulators/ursina_simulator.py
+21
-2
未找到文件。
bodies/fixed_stars/antares.py
浏览文件 @
b6ffb3a5
...
...
@@ -58,7 +58,7 @@ class Antares(FixedStar):
def
__init__
(
self
,
name
=
"心宿二A"
,
mass
=
15.5
*
MO
,
init_position
=
[
0
,
0
,
0
],
init_velocity
=
[
0
,
0
,
0
],
color
=
(
249
,
198
,
83
),
color
=
(
249
,
198
,
83
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.25
,
ignore_mass
=
False
):
params
=
{
...
...
bodies/fixed_stars/betelgeuse.py
浏览文件 @
b6ffb3a5
...
...
@@ -55,7 +55,7 @@ class Betelgeuse(FixedStar):
def
__init__
(
self
,
name
=
"参宿四"
,
mass
=
19
*
MO
,
init_position
=
[
0
,
0
,
0
],
init_velocity
=
[
0
,
0
,
0
],
color
=
(
254
,
162
,
1
),
color
=
(
254
,
162
,
1
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.24
,
ignore_mass
=
False
):
params
=
{
...
...
bodies/fixed_stars/eta_carinae.py
浏览文件 @
b6ffb3a5
...
...
@@ -48,7 +48,7 @@ class EtaCarinae(FixedStar):
def
__init__
(
self
,
name
=
"海山二"
,
mass
=
125
*
MO
,
init_position
=
[
0
,
0
,
0
],
init_velocity
=
[
0
,
0
,
0
],
color
=
(
111
,
140
,
255
),
color
=
(
111
,
140
,
255
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.28
,
ignore_mass
=
False
):
params
=
{
...
...
@@ -72,4 +72,3 @@ if __name__ == '__main__':
print
(
fixed_star
)
fixed_star
.
compare_with_sun
()
fixed_star
.
density_by_radius
(
num_sun_raduis
=
278
)
bodies/fixed_stars/pollux.py
浏览文件 @
b6ffb3a5
...
...
@@ -47,11 +47,6 @@ class Pollux(FixedStar):
年龄 724[12] Myr
其他命名
Beta Geminorum, 78 Geminorum, BD+28°1463, GCTP 1826.00, Gliese 286, HD 62509, HIP 37826, HR 2990, LFT 548, LHS 1945, LTT 12065, SAO 79666.[13]
------------------------
== 太阳参数 ==
自转周期: 24.47 地球日,自转角速度约为 0.6130 度/小时 = 360/(24.47*24)
...
...
bodies/fixed_stars/procyon.py
浏览文件 @
b6ffb3a5
...
...
@@ -65,12 +65,6 @@ class Procyon(FixedStar):
(secondary) 92.2°
其他命名
Elgomaisa, Algomeysa, Antecanis, α Canis Minoris, 10 Canis Minoris,GCTP 1805.00, HR 2943, BD+05°1739, HD 61421, LHS 233, GJ 280, HIP 37279, SAO 115756.[12]
------------------------
== 太阳参数 ==
自转周期: 24.47 地球日,自转角速度约为 0.6130 度/小时 = 360/(24.47*24)
...
...
bodies/fixed_stars/rigel.py
浏览文件 @
b6ffb3a5
...
...
@@ -51,7 +51,7 @@ class Rigel(FixedStar):
def
__init__
(
self
,
name
=
"参宿七"
,
mass
=
18
*
MO
,
init_position
=
[
0
,
0
,
0
],
init_velocity
=
[
0
,
0
,
0
],
color
=
(
141
,
213
,
227
),
color
=
(
141
,
213
,
227
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.33
,
ignore_mass
=
False
):
params
=
{
...
...
bodies/fixed_stars/vy_canis_majoris.py
浏览文件 @
b6ffb3a5
...
...
@@ -52,7 +52,7 @@ class VYCanisMajoris(FixedStar):
def
__init__
(
self
,
name
=
"大犬座VY"
,
mass
=
30
*
MO
,
init_position
=
[
0
,
0
,
0
],
init_velocity
=
[
0
,
0
,
0
],
color
=
(
234
,
90
,
65
),
color
=
(
234
,
90
,
65
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.23
,
ignore_mass
=
False
):
params
=
{
...
...
@@ -66,7 +66,9 @@ class VYCanisMajoris(FixedStar):
"size_scale"
:
size_scale
,
"distance_scale"
:
distance_scale
,
"rotation_speed"
:
rotation_speed
,
"ignore_mass"
:
ignore_mass
"ignore_mass"
:
ignore_mass
,
"texture_bright"
:
1
,
"texture_contrast"
:
5
}
super
().
__init__
(
**
params
)
...
...
scenes/fixed_stars.py
浏览文件 @
b6ffb3a5
...
...
@@ -54,4 +54,5 @@ if __name__ == '__main__':
# 使用 ursina 查看的运行效果
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# position = 左-右+、上+下-、前+后-
ursina_run
(
bodies
,
SECONDS_PER_WEEK
,
position
=
(
0
,
AU
,
-
AU
/
500
),
show_name
=
True
)
ursina_run
(
bodies
,
SECONDS_PER_WEEK
,
position
=
(
0
,
AU
,
-
AU
/
500
),
show_name
=
True
,
bg_music
=
"../sounds/universe_03.mp3"
)
scenes/func.py
浏览文件 @
b6ffb3a5
...
...
@@ -60,6 +60,7 @@ def ursina_run(bodies,
# view_azimuth=0,
light
=
True
,
cosmic_bg
=
None
,
bg_music
=
None
,
show_grid
=
True
,
show_trail
=
False
,
show_name
=
False
,
...
...
@@ -143,7 +144,7 @@ def ursina_run(bodies,
sys
.
modules
[
"__main__"
].
update
=
callback_update
if
show_trail
:
UrsinaConfig
.
show_trail
=
show_trail
simulator
.
run
(
dt
,
light
=
light
,
cosmic_bg
=
cosmic_bg
,
show_grid
=
show_grid
)
simulator
.
run
(
dt
,
light
=
light
,
cosmic_bg
=
cosmic_bg
,
show_grid
=
show_grid
,
bg_music
=
bg_music
)
def
mpl_run
(
bodies
,
dt
=
SECONDS_PER_WEEK
,
gif_file_name
=
None
,
gif_max_frame
=
200
):
...
...
simulators/ursina_simulator.py
浏览文件 @
b6ffb3a5
...
...
@@ -275,8 +275,27 @@ class UrsinaSimulator(Simulator):
EditorCamera
(
ignore_paused
=
True
)
# 防止打开中文输入法
# self.switch_to_english_input_method()
audio
=
Audio
(
'../sounds/universe_04.mp3'
,
pitch
=
1
,
loop
=
True
,
autoplay
=
True
)
# file: 指定音乐文件的路径
# loop: 是否循环播放,默认为 True
# autoplay: 是否自动播放,默认为 True
# volume: 音量大小,取值范围为 0.0 到 1.0,默认为 1.0
# pitch: 音调,取值范围为 0.5 到 2.0,默认为 1.0
# time: 指定音乐从何处开始播放,单位为秒,默认为 0.0
# stop_when_done: 音乐播放完毕后是否停止播放,默认为 True
if
"bg_music"
in
kwargs
:
bg_music
=
kwargs
[
"bg_music"
]
elif
"background_music"
in
kwargs
:
bg_music
=
kwargs
[
"background_music"
]
else
:
bg_music
=
None
if
bg_music
is
None
:
bg_music
=
"../sounds/universe_04.mp3"
if
os
.
path
.
exists
(
bg_music
):
audio
=
Audio
(
bg_music
,
pitch
=
1
,
loop
=
True
,
autoplay
=
True
)
audio
.
volume
=
0.3
self
.
app
.
run
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录