Fixed bug in close_line.py
authorAnthony Scopatz <scopatz@gmail.com>
Tue, 3 Apr 2012 17:19:43 +0000 (12:19 -0500)
committerW. Trevor King <wking@tremily.us>
Fri, 1 Nov 2013 03:23:55 +0000 (20:23 -0700)
W. Trevor King: I dropped everything from the original c7a23ca except
for the 5-Testing/ modification.

Conflicts:
.gitignore
6-Documentation/close_line.py

5-Testing/close_line.py

index bed15db3727b668ae209e431f904a2eba5e7ffd4..a6a5c5ed9644fea74f1978e3dd387cbaaabf19e2 100644 (file)
@@ -19,7 +19,7 @@ def closest_data_to_line1(data, p1, p2):
     dists = np.empty(len(data), dtype=float)
     for i, pdata in enumerate(data):
         x = fmin(dist_from_line1, p1[0], (pdata, p1, p2), disp=False)[0]
-        dists[i] = dist_from_line1(x, pdata)
+        dists[i] = dist_from_line1(x, pdata, p1, p2)
     imin = np.argmin(dists)
     return imin, data[imin]