mailr9480 - /1.3/test_suite/unit_tests/_maths_fns/test_rotation_matrix.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on September 08, 2009 - 17:48:
Author: bugman
Date: Tue Sep  8 17:47:59 2009
New Revision: 9480

URL: http://svn.gna.org/viewcvs/relax?rev=9480&view=rev
Log:
Added another unit test for maths_fns.rotation_matrix.R_axis_angle().


Modified:
    1.3/test_suite/unit_tests/_maths_fns/test_rotation_matrix.py

Modified: 1.3/test_suite/unit_tests/_maths_fns/test_rotation_matrix.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_maths_fns/test_rotation_matrix.py?rev=9480&r1=9479&r2=9480&view=diff
==============================================================================
--- 1.3/test_suite/unit_tests/_maths_fns/test_rotation_matrix.py (original)
+++ 1.3/test_suite/unit_tests/_maths_fns/test_rotation_matrix.py Tue Sep  8 
17:47:59 2009
@@ -410,7 +410,7 @@
             self.assertAlmostEqual(z_new[i], z_real[i])
 
 
-    def test_R_to_axis_angle(self):
+    def test_R_to_axis_angle_no_rot(self):
         """Test the rotation matrix to axis-angle conversion."""
 
         # Generate the rotation matrix.
@@ -421,6 +421,23 @@
 
         # Test the angle.
         self.assertEqual(angle, 0.0)
+
+
+    def test_R_to_axis_angle_180_complex(self):
+        """Test the rotation matrix to axis-angle conversion."""
+
+        # Generate the rotation matrix.
+        R = array([[0, 0, 1], [1, 0, 0], [0, 1, 0]], float64)
+
+        # Get the axis and angle.
+        axis, angle = R_to_axis_angle(R)
+
+        # Test the angle.
+        self.assertEqual(angle, 2 * pi / 3)
+
+        # Test the vector.
+        for i in range(3):
+            self.assertAlmostEqual(axis[i], 1.0/sqrt(3))
 
 
     def test_R_euler_zyz_alpha_30(self):




Related Messages


Powered by MHonArc, Updated Tue Sep 08 18:40:02 2009