sun_earth_jupiter.py 911 字节
Newer Older
M
march3 已提交
1
# -*- coding:utf-8 -*-
M
march3 已提交
2 3
# title           :太阳、地球、木星场景模拟
# description     :太阳、地球、木星场景模拟
M
march3 已提交
4
# author          :Python超人
M
march3 已提交
5 6
# date            :2023-02-11
# link            :https://gitcode.net/pythoncr/
M
march3 已提交
7 8
# python_version  :3.8
# ==============================================================================
M
march3 已提交
9 10 11
from bodies import Sun, Earth, Jupiter
from common.consts import SECONDS_PER_WEEK
from scenes.func import mayavi_run
M
march3 已提交
12 13

if __name__ == '__main__':
M
march3 已提交
14 15 16
    """
    太阳、地球、木星
    """
M
march3 已提交
17
    bodies = [
M
march3 已提交
18 19 20
        Sun(size_scale=1.2e2),                        # 太阳放大 120 倍
        Earth(size_scale=4e3, distance_scale=1),      # 地球放大 4000 倍,距离保持不变
        Jupiter(size_scale=1e3, distance_scale=0.5),  # 木星放大 1000 倍,距离缩小到真实距离的 0.5
M
march3 已提交
21
    ]
M
march3 已提交
22
    mayavi_run(bodies, SECONDS_PER_WEEK, view_azimuth=-45)