Пример #1
0
 def test_array_scalar3(self):
     quat = dcs.quat_mult(self.q6, np.column_stack((self.q6, self.q6)))
     self.assertEqual(quat.ndim, 2)
     np.testing.assert_array_almost_equal(
         quat,
         np.column_stack((dcs.quat_inv(self.q6), dcs.quat_inv(self.q6))))
     np.testing.assert_array_equal(quat.shape, (4, 2))
Пример #2
0
 def test_nominal3(self):
     quat = dcs.quat_mult(self.q6, self.q6)
     self.assertEqual(quat.ndim, 1)
     np.testing.assert_array_almost_equal(quat, dcs.quat_inv(self.q6))
     np.testing.assert_array_equal(quat.shape, self.q6.shape)
Пример #3
0
 def test_reverse(self):
     quat1 = dcs.quat_mult(self.q2, self.q1)
     quat2 = dcs.quat_inv(
         dcs.quat_mult(dcs.quat_inv(self.q1), dcs.quat_inv(self.q2)))
     np.testing.assert_array_almost_equal(quat1, quat2)
Пример #4
0
 def test_quat_array(self):
     q3_inv = dcs.quat_inv(self.q3_inp)
     np.testing.assert_array_almost_equal(q3_inv, self.q3_out)
     self.assertEqual(q3_inv.ndim, 2)
     np.testing.assert_array_equal(q3_inv.shape, self.q3_out.shape)
Пример #5
0
 def test_null_input2(self):
     null_inv = dcs.quat_inv(self.null)
     np.testing.assert_array_equal(null_inv, self.null)
     np.testing.assert_array_equal(null_inv.shape, self.null.shape)
Пример #6
0
 def test_array_scalar3(self):
     quat = dcs.quat_mult(self.q6, np.column_stack((self.q6, self.q6)))
     self.assertEqual(quat.ndim, 2)
     np.testing.assert_array_almost_equal(quat, np.column_stack((dcs.quat_inv(self.q6), dcs.quat_inv(self.q6))))
     np.testing.assert_array_equal(quat.shape, (4, 2))
Пример #7
0
 def test_single_quat2(self):
     q2_inv = dcs.quat_inv(self.q2_inp)
     np.testing.assert_array_almost_equal(q2_inv, self.q2_out)
     self.assertEqual(q2_inv.ndim, 1)
     np.testing.assert_array_equal(q2_inv.shape, self.q2_out.shape)
Пример #8
0
 def test_reverse(self):
     quat1 = dcs.quat_mult(self.q2, self.q1)
     quat2 = dcs.quat_inv(dcs.quat_mult(dcs.quat_inv(self.q1), dcs.quat_inv(self.q2)))
     np.testing.assert_array_almost_equal(quat1, quat2)
Пример #9
0
 def test_nominal3(self):
     quat = dcs.quat_mult(self.q6, self.q6)
     self.assertEqual(quat.ndim, 1)
     np.testing.assert_array_almost_equal(quat, dcs.quat_inv(self.q6))
     np.testing.assert_array_equal(quat.shape, self.q6.shape)
Пример #10
0
 def test_null_input2(self):
     null_inv = dcs.quat_inv(self.null)
     np.testing.assert_array_equal(null_inv, self.null)
     np.testing.assert_array_equal(null_inv.shape, self.null.shape)
Пример #11
0
 def test_quat_array(self):
     q3_inv = dcs.quat_inv(self.q3_inp)
     np.testing.assert_array_almost_equal(q3_inv, self.q3_out)
     self.assertEqual(q3_inv.ndim, 2)
     np.testing.assert_array_equal(q3_inv.shape, self.q3_out.shape)
Пример #12
0
 def test_single_quat2(self):
     q2_inv = dcs.quat_inv(self.q2_inp)
     np.testing.assert_array_almost_equal(q2_inv, self.q2_out)
     self.assertEqual(q2_inv.ndim, 1)
     np.testing.assert_array_equal(q2_inv.shape, self.q2_out.shape)