예제 #1
0
파일: test_physics.py 프로젝트: heckj/om
 def test_acceleration(self):
     self.assertAlmostEquals(6371 * 1000, self.earth_radius)
     basic_gravity = physics.acceleration(self.earth_radius,
                                          self.earth_mass)
     self.assertAlmostEquals(physics.GRAVITY, basic_gravity, places=1)
예제 #2
0
파일: test_physics.py 프로젝트: heckj/om
 def test_gravities(self):
     basic_gravity = physics.acceleration(self.earth_radius,
                                          self.earth_mass)
     self.assertAlmostEquals(1.0, physics.gravities(basic_gravity),
                             places=2)
예제 #3
0
파일: gameobjects.py 프로젝트: heckj/om
 def acceleration_vector(self, thing):
     delta_x = abs(self.vector[0] - thing.vector[0])
     delta_y = abs(self.vector[1] - thing.vector[1])
     distance = math.sqrt(pow(delta_x, 2) + pow(delta_y, 2))
     force = physics.acceleration(distance, thing.mass)