@@ -22,7 +22,7 @@ def assertRotationCloseToIdentity(
2222 self .assertAlmostEqual (float (matrix [2 , 1 ]), 0.0 , delta = tolerance )
2323 self .assertAlmostEqual (float (matrix [2 , 2 ]), 1.0 , delta = tolerance )
2424
25- def test_identity (self ):
25+ def test_identity_3_points (self ):
2626 point_set_from = [
2727 [0.0 , 0.0 , 0.0 ],
2828 [1.0 , 0.0 , 0.0 ],
@@ -38,6 +38,23 @@ def test_identity(self):
3838 self .assertEqual (matrix [3 , 1 ], 0.0 )
3939 self .assertEqual (matrix [3 , 2 ], 0.0 )
4040
41+ def test_identity_4_points (self ):
42+ point_set_from = [
43+ [0.0 , 0.0 , 0.0 ],
44+ [1.0 , 0.0 , 0.0 ],
45+ [0.0 , 1.0 , 0.0 ],
46+ [1.0 , 1.0 , 0.0 ]]
47+ point_set_to = point_set_from
48+ matrix = register_corresponding_points (point_set_from , point_set_to )
49+ self .assertRotationCloseToIdentity (matrix )
50+ self .assertAlmostEqual (matrix [0 , 3 ], 0.0 )
51+ self .assertAlmostEqual (matrix [1 , 3 ], 0.0 )
52+ self .assertAlmostEqual (matrix [2 , 3 ], 0.0 )
53+ self .assertEqual (matrix [3 , 3 ], 1.0 )
54+ self .assertEqual (matrix [3 , 0 ], 0.0 )
55+ self .assertEqual (matrix [3 , 1 ], 0.0 )
56+ self .assertEqual (matrix [3 , 2 ], 0.0 )
57+
4158 def test_translation (self ):
4259 point_set_from = [
4360 [0.0 , 0.0 , 0.0 ],
0 commit comments