From d219842ad86b93392c06b3d2ee1cf674ae1e5fed Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 9 Dec 2018 20:19:17 +0100 Subject: [PATCH] [skip ci] consistent tolerances --- processing/post/addOrientations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/processing/post/addOrientations.py b/processing/post/addOrientations.py index 141083036..803d585e3 100755 --- a/processing/post/addOrientations.py +++ b/processing/post/addOrientations.py @@ -28,9 +28,9 @@ def check_quaternion(q): def check_matrix(M): if not np.isclose(np.linalg.det(M),1.0): # proper rotation? raise ValueError('matrix is not a proper rotation.\n{}'.format(M)) - if abs(np.dot(M[0],M[1])) > 1e-8 \ - or abs(np.dot(M[1],M[2])) > 1e-8 \ - or abs(np.dot(M[2],M[0])) > 1e-8: # all orthogonal? + if not np.isclose(np.dot(M[0],M[1]), 0.0) \ + or not np.isclose(np.dot(M[1],M[2]), 0.0) \ + or not np.isclose(np.dot(M[2],M[0]), 0.0): # all orthogonal? raise ValueError('matrix is not orthogonal.\n{}'.format(M)) return M