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))
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)
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)
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)
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)
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))
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)
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)