【问题标题】:Python 3.9.0 - Physics simulation of drag working abnormallyPython 3.9.0 - 阻力工作异常的物理模拟
【发布时间】:2021-10-31 20:34:48
【问题描述】:
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]

我相信这就是问题所在,而且只有当弹丸向右移动时才会发生这种情况。

not working...

working

【问题讨论】:

    标签: python-3.x simulation projectile


    【解决方案1】:

    我忘记了力计算中的负号

    【讨论】:

      猜你喜欢
      • 2013-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多