mailr9133 - /branches/frame_order/maths_fns/frame_order_matrix_ops.py


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

Header


Content

Posted by edward on June 23, 2009 - 12:58:
Author: bugman
Date: Tue Jun 23 12:58:40 2009
New Revision: 9133

URL: http://svn.gna.org/viewcvs/relax?rev=9133&view=rev
Log:
Bug fix for the compile_2nd_matrix_iso_cone() function.

The cross product of 2 normal vectors is not a normal vector!!!


Modified:
    branches/frame_order/maths_fns/frame_order_matrix_ops.py

Modified: branches/frame_order/maths_fns/frame_order_matrix_ops.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order/maths_fns/frame_order_matrix_ops.py?rev=9133&r1=9132&r2=9133&view=diff
==============================================================================
--- branches/frame_order/maths_fns/frame_order_matrix_ops.py (original)
+++ branches/frame_order/maths_fns/frame_order_matrix_ops.py Tue Jun 23 
12:58:40 2009
@@ -26,8 +26,10 @@
 # Python module imports.
 from math import cos, sin
 from numpy import cross, dot, transpose
+from numpy.linalg import norm
 
 # relax module imports.
+from float import isNaN
 from maths_fns.kronecker_product import kron_prod, transpose_14
 from maths_fns.rotation_matrix import R_axis_angle
 
@@ -59,6 +61,9 @@
 
     # The axis of rotation (cross product of the z-axis and cone axis).
     mu_rot = cross(z_axis, cone_axis)
+    mu_len = norm(mu_rot)
+    if mu_len != 0.0:
+        mu_rot = mu_rot / mu_len
 
     # Generate the rotation matrix.
     R_axis_angle(R, mu_rot, theta_axis)




Related Messages


Powered by MHonArc, Updated Tue Jun 23 14:00:04 2009