6 code.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:computational_physics_N2014301020117 作者: yukangnineteen 项目源码 文件源码
def __init__(self, initial_velocity, firing_angle, time_step, velocity_of_wind, angle_of_wind):
        self.x = [0]
        self.y = [0]
        self.theta = firing_angle
        self.alpha = angle_of_wind
        self.v_x = [initial_velocity * math.cos(self.theta / 180 * math.pi)]
        self.v_y = [initial_velocity * math.sin(self.theta / 180 * math.pi)]
        self.v0 = initial_velocity
        self.v = initial_velocity
        self.v_w = velocity_of_wind
        self.v_w_x = self.v_w * math.cos(self.alpha / 180 * math.pi)
        self.v_w_y = self.v_w * math.sin(self.alpha / 180 * math.pi)
        self.v_rel_x = self.v_x[0] - self.v_w_x
        self.v_rel_y = self.v_y[0] - self.v_w_y
        self.v_rel_module = math.hypot(self.v_rel_x, self.v_rel_y)
        self.C = 0
        self.B_2 = 0
        self.g = 9.8
        self.dt = time_step
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号