made the return signature of the 4th close line function the same as all the otehrs
authorgidden <matthew.gidden@gmail.com>
Sun, 21 Apr 2013 20:03:25 +0000 (15:03 -0500)
committerW. Trevor King <wking@tremily.us>
Fri, 1 Nov 2013 16:40:01 +0000 (09:40 -0700)
python/testing/close_line.py

index a6a5c5ed9644fea74f1978e3dd387cbaaabf19e2..f49cc9ad3e36d5a68d2dcc32db6afe6cd10d1647 100644 (file)
@@ -64,6 +64,7 @@ def closest_data_to_line3(data, p1, p2):
 #
 
 def closest_data_to_line4(data, p1, p2):
-    return data[np.argmin(np.sqrt(np.sum((p1 - data)**2, axis=1)) + \
-                np.sqrt(np.sum((p2 - data)**2, axis=1)))]
+    imin = np.argmin(np.sqrt(np.sum((p1 - data)**2, axis=1)) + \
+                np.sqrt(np.sum((p2 - data)**2, axis=1)))
+    return imin, data[imin]