mailr10956 - /1.3/generic_fns/structure/cones.py


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

Header


Content

Posted by edward on March 09, 2010 - 15:30:
Author: bugman
Date: Tue Mar  9 15:29:59 2010
New Revision: 10956

URL: http://svn.gna.org/viewcvs/relax?rev=10956&view=rev
Log:
The limit_check() method has been added to the cone objects to determine if a 
point is inside or not.


Modified:
    1.3/generic_fns/structure/cones.py

Modified: 1.3/generic_fns/structure/cones.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/cones.py?rev=10956&r1=10955&r2=10956&view=diff
==============================================================================
--- 1.3/generic_fns/structure/cones.py (original)
+++ 1.3/generic_fns/structure/cones.py Tue Mar  9 15:29:59 2010
@@ -39,6 +39,25 @@
 
         # Store the cone angle.
         self._angle = angle
+
+
+    def limit_check(self, phi, theta):
+        """Determine if the point is within the cone.
+
+        @param phi:     The polar angle.
+        @type phi:      float
+        @param theta:   The azimuthal angle.
+        @type phi:      float
+        @return:        True if the point is within the cone, False 
otherwise.
+        @rtype:         bool
+        """
+
+        # Outside.
+        if phi > self._angle:
+            return False
+
+        # Else inside.
+        return True
 
 
     def phi_max(self, theta):
@@ -92,3 +111,22 @@
 
         # Return the limit.
         return phi_max
+
+
+    def limit_check(self, phi, theta):
+        """Determine if the point is within the cone.
+
+        @param phi:     The polar angle.
+        @type phi:      float
+        @param theta:   The azimuthal angle.
+        @type phi:      float
+        @return:        True if the point is within the cone, False 
otherwise.
+        @rtype:         bool
+        """
+
+        # Outside.
+        if phi > self.phi_max(theta):
+            return False
+
+        # Else inside.
+        return True




Related Messages


Powered by MHonArc, Updated Tue Mar 09 19:20:02 2010