def test_negate(self): result = quaternion.negate([1., 2., 3., 4.]) np.testing.assert_almost_equal(result, [-1., -2., -3., -4.], decimal=5)
def test_negate_unit(self): result = quaternion.negate([0., 0., 0., 1.]) np.testing.assert_almost_equal(result, [0., 0., 0., -1.], decimal=5)
def test_negative(self): q = Quaternion.from_x_rotation(np.pi / 2.0) self.assertTrue(np.allclose(q.negative, quaternion.negate(q)))