Author: bugman Date: Fri Sep 18 14:04:52 2009 New Revision: 9528 URL: http://svn.gna.org/viewcvs/relax?rev=9528&view=rev Log: Created the euler_zyz_to_axis_angle() conversion function. Modified: 1.3/maths_fns/rotation_matrix.py Modified: 1.3/maths_fns/rotation_matrix.py URL: http://svn.gna.org/viewcvs/relax/1.3/maths_fns/rotation_matrix.py?rev=9528&r1=9527&r2=9528&view=diff ============================================================================== --- 1.3/maths_fns/rotation_matrix.py (original) +++ 1.3/maths_fns/rotation_matrix.py Fri Sep 18 14:04:52 2009 @@ -117,6 +117,32 @@ quat[1:] = axis * sin(angle/2) +def euler_zyz_to_axis_angle(alpha, beta, gamma): + """Function for calculating the z-y-z Euler angle convention rotation matrix. + + This function first generates a rotation matrix via euler_zyz_to_R() and then uses this together + with R_to_axis_angle() to get the axis and angle. + + @param alpha: The alpha Euler angle in rad. + @type alpha: float + @param beta: The beta Euler angle in rad. + @type beta: float + @param gamma: The gamma Euler angle in rad. + @type gamma: float + @return: The 3D rotation axis and angle. + @rtype: numpy 3D rank-1 array, float + """ + + # Init. + R = zeros((3, 3), float64) + + # Get the rotation. + euler_zyz_to_R(alpha, beta, gamma, R) + + # Return the axis and angle. + return R_to_axis_angle(R) + + def euler_zyz_to_R(alpha, beta, gamma, R): """Function for calculating the z-y-z Euler angle convention rotation matrix.