提交 d159c082 编写于 作者: 三月三net's avatar 三月三net

Python超人-宇宙模拟器

上级 eb4d7897
......@@ -240,7 +240,14 @@ def create_trail_info(body, trail):
velocity = merge_vectors(body.velocity)
acceleration = merge_vectors(body.acceleration)
vel_info = "%.2fkm/s" % (velocity[0])
acc_info = "%.2fm/s²" % (acceleration[0] * 1000)
acc_m = acceleration[0] * 1000
if acc_m >= 0.01:
acc_info = "%.2fm/s²" % (acc_m)
else:
acc_info = "%.2fmm/s²" % (acc_m * 1000)
vel_direction = velocity[1]
vel_direction = np.array(vel_direction) * 5
......@@ -265,7 +272,12 @@ def create_trail_text_xxx(body, trail):
velocity = merge_vectors(body.velocity)
acceleration = merge_vectors(body.acceleration)
vel_info = "%.2fkm/s" % (velocity[0])
acc_info = "%.2fm/s²" % (acceleration[0] * 1000)
acc_m = acceleration[0] * 1000
if acc_m >= 0.01:
acc_info = "%.2fm/s²" % (acc_m)
else:
acc_info = "%.2fmm/s²" % (acc_m * 1000)
vel_direction = velocity[1]
vel_direction = np.array(vel_direction) * 5
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册