mailr11428 - /1.3/maths_fns/coord_transform.py


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

Header


Content

Posted by edward on August 06, 2010 - 13:47:
Author: bugman
Date: Fri Aug  6 13:47:54 2010
New Revision: 11428

URL: http://svn.gna.org/viewcvs/relax?rev=11428&view=rev
Log:
Switched the theta and phi angles in cartesian_to_spherical() to match the 
rest of relax.


Modified:
    1.3/maths_fns/coord_transform.py

Modified: 1.3/maths_fns/coord_transform.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/maths_fns/coord_transform.py?rev=11428&r1=11427&r2=11428&view=diff
==============================================================================
--- 1.3/maths_fns/coord_transform.py (original)
+++ 1.3/maths_fns/coord_transform.py Fri Aug  6 13:47:54 2010
@@ -30,14 +30,14 @@
 
 
 def cartesian_to_spherical(vector):
-    """Convert the Cartesian vector [x, y, z] to spherical coordinates [r, 
phi, theta].
+    """Convert the Cartesian vector [x, y, z] to spherical coordinates [r, 
theta, phi].
 
-    The parameter r is the radial distance, phi is the polar angle, and 
theta is the azimuth.
+    The parameter r is the radial distance, theta is the polar angle, and 
phi is the azimuth.
 
 
     @param vector:  The Cartesian vector [x, y, z].
     @type vector:   numpy rank-1, 3D array
-    @return:        The spherical coordinate vector [r, phi, theta].
+    @return:        The spherical coordinate vector [r, theta, phi].
     @rtype:         numpy rank-1, 3D array
     """
 
@@ -48,10 +48,10 @@
     unit = vector / r
 
     # The polar angle.
-    phi = acos(unit[2])
+    theta = acos(unit[2])
 
     # The azimuth.
-    theta = atan2(unit[1], unit[0])
+    phi = atan2(unit[1], unit[0])
 
     # Return the spherical coordinate vector.
-    return array([r, phi, theta], float64)
+    return array([r, theta, phi], float64)




Related Messages


Powered by MHonArc, Updated Fri Aug 06 14:20:02 2010