首页 > 解决方案 > Python 3.9.0 - 阻力工作异常的物理模拟

问题描述

def CalculateAcceleration(self):
    currentTheta = math.atan(self.velocity[1]/self.velocity[0])
    currentSquaredVelocity = math.pow(self.velocity[0],2)+math.pow(self.velocity[1],2)
    accelerationMagnitude = currentSquaredVelocity*self.coeffD
    self.acceleration = [math.cos(currentTheta)*accelerationMagnitude, math.sin(currentTheta)*accelerationMagnitude]
    self.acceleration = [self.acceleration[0], self.acceleration[1]-self.g]

我相信这就是问题所在,并且仅在弹丸向右移动时才会发生。

不工作...

在职的

标签: python-3.xsimulationprojectile

解决方案


我忘记了力计算中的负号


推荐阅读