wr21a.py 1.7 KB
Newer Older
三月三net's avatar
三月三net 已提交
1 2 3 4 5 6 7 8
# -*- coding:utf-8 -*-
# title           :天鹅座WR
# description     :天鹅座WR
# author          :Python超人
# date            :2023-02-11
# link            :https://gitcode.net/pythoncr/
# python_version  :3.8
# ==============================================================================
三月三net's avatar
三月三net 已提交
9
from bodies import FixedStar
三月三net's avatar
三月三net 已提交
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
from common.consts import MO


class WR21a(FixedStar):
    """
    TODO: 天鹅座WR 21a
    质量:83.6 太阳质量
    大小:320 太阳半径
    颜色:0xFF, 0x5B, 0x5B
    密度:0.001 g/cm³
    ------------------------
    == 太阳参数 ==
    自转周期: 24.47 地球日,自转角速度约为 0.6130 度/小时 = 360/(24.47*24)
    天体质量: 1.9891×10³⁰ kg
    平均密度: 1.408×10³ kg/m³
    """

    def __init__(self, name="天鹅座", mass=83.6 * MO,
                 init_position=[0, 0, 0],
                 init_velocity=[0, 0, 0],
                 color=(0xFF, 0x5B, 0x5B),
                 texture="fixed_star.png", size_scale=1.0, distance_scale=1.0,
                 rotation_speed=0.1, ignore_mass=False):
        params = {
            "name": name,
            "mass": mass,
            "init_position": init_position,
            "init_velocity": init_velocity,
            "density": 1.408e3,
            "color": color,
            "texture": texture,
            "size_scale": size_scale,
            "distance_scale": distance_scale,
            "rotation_speed": rotation_speed,
            "ignore_mass": ignore_mass
        }
        super().__init__(**params)


if __name__ == '__main__':
三月三net's avatar
三月三net 已提交
50
    from bodies import Sun
三月三net's avatar
三月三net 已提交
51 52 53 54 55
    fixed_star = WR21a()
    sun = Sun()
    print(fixed_star)
    print("质量倍数", fixed_star.mass / sun.mass)
    print("半径倍数", fixed_star.raduis / sun.raduis)