Exemple #1
0
 def mobObjectChangeSpeedDirection(item: MobileObject, normalVector):
     """ count a reflection angle"""
     [speedValue, direction] = item.get_speed()
     direction = tda.reflectance_angle(normalToSurface=normalVector,
                                       angle=direction)
     item.set_contact()
     item.set_speed(value=speedValue, direction=direction)
 def test_refl_ang3(self):
     result = tda.reflectance_angle(normalToSurface=150, angle=35)
     self.assertEqual(result, 265)
 def test_refl_ang2(self):
     result = tda.reflectance_angle(normalToSurface=45, angle=30)
     self.assertEqual(result, 60)
 def test_refl_ang1(self):
     result = tda.reflectance_angle(normalToSurface=90, angle=30)
     self.assertEqual(result, 150)