Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bug in close_line.py

  • Loading branch information...
commit c7a23ca2a4ec688f500c221edacce7f3824585f0 1 parent 8b58577
@scopatz authored
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]
Please sign in to comment.
Something went wrong with that request. Please try again.