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 = RotationD([+2, -1, -3, +0]) mat = pre_r.matrix() r = RotationD(mat) numpy.testing.assert_allclose(mat, r.matrix(), 1e-15)
def test_to_matrix(self): # Default value should be identity rot_d = RotationD() numpy.testing.assert_array_equal(rot_d.matrix(), numpy.eye(3)) rot_f = RotationF() numpy.testing.assert_array_equal(rot_f.matrix(), numpy.eye(3))