Пример #1
0
 def test_accion(self):
     a=[[(2,0),(2,0),(2,0)]]
     b=[[(2,0),(2,0),(2,0)],
        [(2,0),(2,0),(2,0)],
        [(2,0),(2,0),(2,0)]]
     c=[[(8, 0), (8, 0), (8, 0)]]
     self.assertEqual(ComplejosVector.accion(a,b), c)
Пример #2
0
 def test_matConj(self):
     a=[[(2,3),(1,9),(4,6)],
        [(2,5),(1,2),(3,6)],
        [(4,7),(4,9),(7,2)]]
     b=[[(2,-3),(1,-9),(4,-6)],
        [(2,-5),(1,-2),(3,-6)],
        [(4,-7),(4,-9),(7,-2)]]
     self.assertEqual(ComplejosVector.matConj(a), b)
Пример #3
0
 def test_tensor(self):
     a=[[(2,0)],
        [(3,0)]]
     b=[[(4,0)],[(6,0)],[(3,0)]]
     c=[[[(8, 0)]], [[(12, 0)]],
        [[(6, 0)]], [[(12, 0)]], 
        [[(18, 0)]], [[(9, 0)]]]
     self.assertEqual(ComplejosVector.tensor(a,b), c)
Пример #4
0
 def test_inverMat(self):
     a = [[(1,2)],
          [(3,3)],
          [(1,1)]]
     c = [[(-1, -2)], 
          [(-3, -3)], 
          [(-1, -1)]]
     self.assertEqual(ComplejosVector.inverMat(a), c)    
Пример #5
0
 def test_sumMat(self):
     a = [[(1,2)],
          [(2,1)]]
     b = [[(3,1)],
          [(1,3)]]
     c = [[(4,3)],
          [(3,4)]]
     self.assertEqual(ComplejosVector.sumMat(a,b), c)    
Пример #6
0
 def test_matTrans(self):
     a=[[(2,3),(1,9),(4,6)],
        [(2,5),(1,2),(3,6)],
        [(4,7),(4,9),(7,2)]]
     b=[[(2,3),(2,5),(4,7)],
        [(1,9),(1,2),(4,9)],
        [(4,6),(3,6),(7,2)]]
     self.assertEqual(ComplejosVector.matTrans(a), b)
Пример #7
0
 def test_Escamat(self):
     a = 3
     b = [[(1,2)],
          [(3,3)],
          [(1,1)]]
     c = [[(3,6)],
          [(9,9)],
          [(3,3)]]
     self.assertEqual(ComplejosVector.Escamat(a,b), c)    
Пример #8
0
 def test_suma(self):
     self.assertEqual(ComplejosVector.suma((2, 6), (4, 9)), (6, 15))
Пример #9
0
 def test_mulvec(self):
     a = 3
     b = [(1,2),(3,1)]
     c = [(3,6),(9,3)]
     self.assertEqual(ComplejosVector.mulvec(a,b), c)
Пример #10
0
 def test_invervec(self):
     a = [(1,2),(2,1)]
     c = [(-1,-2),(-2,-1)]
     self.assertEqual(ComplejosVector.invervec(a), c)
Пример #11
0
 def test_unitaria(self):
     a=[[(1,0),(0,0)],
        [(0,0),(1,0)]]
     self.assertEqual(ComplejosVector.unitaria(a), True)    
Пример #12
0
 def test_producto(self):
     self.assertEqual(ComplejosVector.producto((2, 6), (4, 9)), (-46, 42))
Пример #13
0
 def test_convercarpol(self):
     self.assertEqual(ComplejosVector.convercarpol((2, 6)), (6.3246, 71.5651))
Пример #14
0
 def test_conj(self):
     self.assertEqual(ComplejosVector.conj((2, 6)), (2, -6))
Пример #15
0
 def test_mod(self):
     self.assertEqual(ComplejosVector.mod((2, 6)), 6.3246)
Пример #16
0
 def test_div(self):
     self.assertEqual(ComplejosVector.div((2, 6), (4, 9)), (0.6392, 0.0619))
Пример #17
0
 def test_Hermi(self):
     a=[[(7,0)],[(6,5)],
     [(6,-5)],[(-3,0)]]
     self.assertEqual(ComplejosVector.Hermi(a), False)    
Пример #18
0
 def test_matAdjun(self):
     a=[[(1,-1),(0,0)],
        [(3,4),(-1,0)]]
     b=[[(1,1),(3,-4)],
        [(0,0),(-1,0)]]
     self.assertEqual(ComplejosVector.matAdjun(a), b)
Пример #19
0
 def test_resta(self):
     self.assertEqual(ComplejosVector.resta((2, 6), (4, 9)), (-2, -3))
Пример #20
0
 def test_fase(self):
     self.assertEqual(ComplejosVector.fase((2, 6)), (71.5651))
Пример #21
0
 def test_distancia(self):
     a=[[(1,2)],[(2,1)]]
     b=[[(2,1)],[(3,2)]]
     c=2.0
     self.assertEqual(ComplejosVector.distancia(a,b), c)
Пример #22
0
 def test_sumvec(self):
     a = [(1,2),(2,1)]
     b = [(1,3),(3,1)]
     c = [(2,5),(5,2)]
     self.assertEqual(ComplejosVector.sumvec(a,b), c)
Пример #23
0
 def test_norma(self):
     a=[[(8,6)],[(6,-8)]]
     c=14.14
     self.assertEqual(ComplejosVector.norma(a), c)