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

Python超人-宇宙模拟器

上级 7b03d287
...@@ -47,7 +47,7 @@ class JupiterProtectsEarthSim: ...@@ -47,7 +47,7 @@ class JupiterProtectsEarthSim:
def random_pos_vel(self): def random_pos_vel(self):
# 随机生成石头的位置和初始速度信息 # 随机生成石头的位置和初始速度信息
radius = calculate_distance(self.jupiter.position, self.sun.position) * 2 radius = calculate_distance(self.jupiter.position, self.sun.position) * 1.5
x = radius * math.cos(random.uniform(0, 2 * math.pi)) * (random.randint(100, 150) / 100) x = radius * math.cos(random.uniform(0, 2 * math.pi)) * (random.randint(100, 150) / 100)
z = radius * math.sin(random.uniform(0, 2 * math.pi)) * (random.randint(100, 150) / 100) z = radius * math.sin(random.uniform(0, 2 * math.pi)) * (random.randint(100, 150) / 100)
sun_pos = self.sun.position sun_pos = self.sun.position
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册