mailr23471 - in /branches/frame_order_cleanup: ./ lib/geometry/lines.py


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

Header


Content

Posted by edward on May 27, 2014 - 16:32:
Author: bugman
Date: Tue May 27 16:32:44 2014
New Revision: 23471

URL: http://svn.gna.org/viewcvs/relax?rev=23471&view=rev
Log:
Merged revisions 23470 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r23470 | bugman | 2014-05-27 16:30:56 +0200 (Tue, 27 May 2014) | 6 lines
  
  Fix for the lib.geometry.lines.closest_point_ax() function for when the two 
points are the same.
  
  If the point on the line and point in the 3D space are the same, then this 
function used to return
  an array of NaN values.  This situation is now caught and the point in the 
3D space is returned.
........

Modified:
    branches/frame_order_cleanup/   (props changed)
    branches/frame_order_cleanup/lib/geometry/lines.py

Propchange: branches/frame_order_cleanup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue May 27 16:32:44 2014
@@ -1 +1 @@
-/trunk:1-23468
+/trunk:1-23470

Modified: branches/frame_order_cleanup/lib/geometry/lines.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/lib/geometry/lines.py?rev=23471&r1=23470&r2=23471&view=diff
==============================================================================
--- branches/frame_order_cleanup/lib/geometry/lines.py  (original)
+++ branches/frame_order_cleanup/lib/geometry/lines.py  Tue May 27 16:32:44 
2014
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2013 Edward d'Auvergne                                       
 #
+# Copyright (C) 2013-2014 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -66,6 +66,10 @@
     @rtype:             numpy rank-1 array
     """
 
+    # Check if the two points are the same, returning the point to avoid 
NaNs.
+    if norm(line_pt - point) < 1e-6:
+        return point
+
     # The hypotenuse.
     hypo = point - line_pt
     hypo_len = norm(hypo)




Related Messages


Powered by MHonArc, Updated Tue May 27 17:20:03 2014