Permalink
Browse files

Fixed bug in close_line.py

  • Loading branch information...
1 parent 8b58577 commit c7a23ca2a4ec688f500c221edacce7f3824585f0 @scopatz scopatz committed Apr 3, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 5-Testing/close_line.py
  3. +1 −1 6-Documentation/close_line.py
View
1 .gitignore
@@ -6,3 +6,4 @@ madeit_emails.txt
*cachegrind*
6-Documentation/close_line.md
6-Documentation/index.md
+*.pyc
View
2 5-Testing/close_line.py
@@ -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]
View
2 6-Documentation/close_line.py
@@ -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]

0 comments on commit c7a23ca

Please sign in to comment.