Ejemplo n.º 1
0
    def test_normalize(self):
        a = VMD(3,4, math.sqrt(39.0))
        pre_norm = a.norm()
        self.assertEquals(pre_norm, a.normalize())

        b = VMD(3./8,4./8, math.sqrt(39.0)/8.) # normalized version
        self.assertAlmostEquals(b[0], a[0], places=6)
        self.assertAlmostEquals(b[1], a[1], places=6)
        self.assertAlmostEquals(b[2], a[2], places=6)
Ejemplo n.º 2
0
    def test_normalize(self):
        a = VMD(3, 4, math.sqrt(39.0))
        pre_norm = a.norm()
        self.assertEqual(pre_norm, a.normalize())

        b = VMD(3. / 8, 4. / 8, math.sqrt(39.0) / 8.)  # normalized version
        self.assertAlmostEquals(b[0], a[0], places=6)
        self.assertAlmostEquals(b[1], a[1], places=6)
        self.assertAlmostEquals(b[2], a[2], places=6)
Ejemplo n.º 3
0
 def test_norm(self):
     p = VMD(1.0, -5.0, 8.0)
     self.assertAlmostEquals(p.norm(), math.sqrt(90.0), places=6)
Ejemplo n.º 4
-1
 def test_norm(self):
     p = VMD(1.0,-5.0,8.0);
     self.assertAlmostEquals(p.norm(), math.sqrt(90.0),places=6)