def test_from_matrix(self): # Create a non-identity matrix from a different constructor that we # assume works # Create new rotation with that matrix. # New rotation to_matrix method should produce the same matrix pre_r = Rotation.from_quaternion([+2, -1, -3, +0]) mat = pre_r.matrix() r = Rotation.from_matrix(mat) numpy.testing.assert_allclose(mat, r.matrix(), 1e-15)
def test_from_matrix(self): # Create a non-identity matrix from a different constructor that we # assume works # Create new rotation with that matrix. # New rotation to_matrix method should produce the same matrix pre_r = Rotation.from_quaternion([[+2], [-1], [-3], [+0]]) mat = pre_r.matrix() r = Rotation.from_matrix(mat) numpy.testing.assert_equal(mat, r.matrix())