8000 add test for trinv · suddrey-qut/spatialmath-python@573ef2f · GitHub
[go: up one dir, main page]

Skip to content

Commit 573ef2f

Browse files
committed
add test for trinv
1 parent 31f4f68 commit 573ef2f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spatialmath/base/test_transforms.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,16 @@ def test_plot(self):
446446

447447
class Test3D(unittest.TestCase):
448448

449+
def test_trinv(self):
450+
T = np.eye(4)
451+
nt.assert_array_almost_equal(trinv(T), T)
452+
453+
T = trotx(0.3)
454+
nt.assert_array_almost_equal(trinv(T)@T, np.eye(4))
455+
456+
T = transl(1,2,3)
457+
nt.assert_array_almost_equal(trinv(T)@T, np.eye(4))
458+
449459
def test_rotx(self):
450460
R = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
451461
nt.assert_array_almost_equal(rotx(0), R)

0 commit comments

Comments
 (0)
0