Example #1
0
 def test_with_scalar(self):
     v = 3.0e5
     exp = 1 / sqrt(1 + v**2 / c_lgt**2)
     self.assertAlmostEqual(rel.gamma(v), exp, places=4)
Example #2
0
 def test_v_eq_zero(self):
     v_zero = numpy.zeros(3)
     self.assertEqual(rel.gamma(v_zero), 1.0)
Example #3
0
 def test_v_eq_zero(self):
     v_zero = numpy.zeros(3)
     self.assertEqual(rel.gamma(v_zero), 1.0)
Example #4
0
 def test_with_scalar(self):
     v = 3.0e5
     exp = 1 / sqrt(1 + v**2 / c_lgt**2)
     self.assertAlmostEqual(rel.gamma(v), exp, places=4)
Example #5
0
 def velocity(self, new):
     gam = rel.gamma(new)
     p_si = gam * self.mass_kg * new
     self.momentum = p_si / e_chg * c_lgt * 1e-6