Author: bugman Date: Thu May 28 15:37:08 2009 New Revision: 9062 URL: http://svn.gna.org/viewcvs/relax?rev=9062&view=rev Log: Renamed random_R() to R_random_axis(). 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=9062&r1=9061&r2=9062&view=diff ============================================================================== --- 1.3/maths_fns/rotation_matrix.py (original) +++ 1.3/maths_fns/rotation_matrix.py Thu May 28 15:37:08 2009 @@ -204,6 +204,21 @@ matrix[2,2] = cos_b +def R_random_axis(matrix, angle=0.0): + """Generate a random rotation matrix of fixed angle via the axis-angle notation. + + Uniform point sampling on a unit sphere is used to generate a random axis orientation. This, + together with the fixed rotation angle, is used to generate the random rotation matrix. + """ + + # Random rotation axis. + rot_axis = zeros(3, float64) + random_rot_axis(rot_axis) + + # Generate the rotation matrix. + R_axis_angle(matrix, rot_axis, angle) + + def random_rot_axis(axis): """Generate a random rotation axis. @@ -225,19 +240,3 @@ axis[0] = cos(theta) * sin(phi) axis[1] = sin(theta) * sin(phi) axis[2] = cos(phi) - - -def random_R(matrix, angle=0.0): - """Generate a random rotation matrix of fixed angle via the axis-angle notation. - - Uniform point sampling on a unit sphere is used to generate a random axis orientation. This, - together with the fixed rotation angle, is used to generate the random rotation matrix. - - """ - - # Random rotation axis. - rot_axis = zeros(3, float64) - random_rot_axis(rot_axis) - - # Generate the rotation matrix. - R_axis_angle(matrix, rot_axis, angle)