def test_hypot3(self): """test hypot3() function ...........................""" for i in range(10): r1 = random.randint(1,100) + 0.5 r2 = random.randint(1,100) + 0.5 r3 = random.randint(1,100) + 0.5 h1 = math.sqrt(r1*r1+r2*r2+r3*r3) h2 = Util.hypot3(r1,r2,r3) testlib.assertfloat(self, h1, h2)
def test_angle_sub_pi(self): """test angle_sub_pi() function .....................""" self.assertEqual(Util.angle_sub_pi(2,1), 1) testlib.assertfloat(self, Util.angle_sub_pi(4,1), 0.14159)
def test_angle_sub_2pi(self): """test angle_sub_2pi() function ....................""" self.assertEqual(Util.angle_sub_2pi(3,1), 2) testlib.assertfloat(self, Util.angle_sub_2pi(6,1), 1.28318536);