Commits

German Larrain committed cd8c201

tests.utilities_geometry: fixed 'test_get_inclination' and changed test cases.

  • Participants
  • Parent commits 1616299

Comments (0)

Files changed (1)

File tests/utils_geometry.py

 	print(ht2)
 	print(ht3)
 
-def test_calc_inclination(axis, angle, correct):
+def test_calc_inclination(axis, angle):
 	#axis = mut.upAxis
 	#angle = mut.pi/4
 	rot_matrix = gemut.calc_rotation_matrix(axis, angle)
-	res = gemut.calc_inclination(rot_matrix, mut.upAxis)
-	print('angle: %f' % angle)
-	print('tilt: %f' % res)
-	print('error: %f' % (correct - res))
+	pitch, roll = gemut.calc_inclination(rot_matrix)
+	print('axis: %s, angle: %f' % (axis, angle))
+	print('pitch: %f, roll: %f' % (pitch, roll))
 	print('')
 
 if __name__ == "__main__":
 
 	# rotation around axii perpendicular to the ground does not affect
 	# the inclination
-	test_calc_inclination(mut.upAxis, mut.pi/4, 0)
-	test_calc_inclination(mut.upAxis, 3*mut.pi/9, 0)
-	test_calc_inclination(mut.upAxis, -mut.pi/8, 0)
-	test_calc_inclination(mut.downAxis, mut.pi/4, 0)
-	test_calc_inclination(mut.downAxis, 3*mut.pi/9, 0)
-	test_calc_inclination(mut.downAxis, -mut.pi/8, 0)
+	test_calc_inclination(mut.upAxis, mut.pi/4)
+	test_calc_inclination(mut.upAxis, 3*mut.pi/9)
+	test_calc_inclination(mut.upAxis, -mut.pi/8)
+	test_calc_inclination(mut.downAxis, mut.pi/4)
+	test_calc_inclination(mut.downAxis, 3*mut.pi/9)
+	test_calc_inclination(mut.downAxis, -mut.pi/8)
 
-	test_calc_inclination(mut.rightAxis, mut.pi/6, mut.pi/6)
-	test_calc_inclination(mut.rightAxis, 3*mut.pi/9, 3*mut.pi/9)
-	test_calc_inclination(mut.rightAxis, -mut.pi/8, -mut.pi/8)
+	test_calc_inclination(mut.rightAxis, mut.pi/6)
+	test_calc_inclination(mut.rightAxis, 3*mut.pi/9)
+	test_calc_inclination(mut.rightAxis, -mut.pi/8)
+	test_calc_inclination(mut.leftAxis, mut.pi/8)
+	test_calc_inclination(mut.bkwdAxis, mut.pi/8)
+