sun.py 995 字节
Newer Older
M
march3 已提交
1 2 3 4 5 6 7 8 9 10 11 12
# -*- coding:utf-8 -*-
# title           :
# description     :
# author          :Python超人
# date            :2023-01-22
# notes           :
# python_version  :3.8
# ==============================================================================
from bodies.body import Body


class Sun(Body):
M
march3 已提交
13
    def __init__(self, name="Sun", mass=1.9891e30,
M
march3 已提交
14 15
                 init_position=[0, 0, 0],
                 init_velocity=[0, 0, 0],
M
march3 已提交
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
                 texture="", size_scale=1.0, distance_scale=1.0):
        params = {
            "name": name,
            "mass": mass,
            "init_position": init_position,
            "init_velocity": init_velocity,
            "density": 1.408e3,
            "color": [
                125,
                125,
                125
            ],
            "texture": texture,
            "size_scale": size_scale,
            "distance_scale": distance_scale
        }
        super().__init__(**params)


if __name__ == '__main__':
    print(Sun())