Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a2cf39

Browse files
committed
Remove mlab.segments_intersect
1 parent 3af78b2 commit 2a2cf39

File tree

3 files changed

+2
-28
lines changed

3 files changed

+2
-28
lines changed

doc/api/next_api_changes/2018-09-18-DS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ in Matplotlib 2.2 has been removed. See below for a list:
2525
- `mlab.less_simple_linear_interpolation` (use numpy.interp)
2626
- `mlab.slopes`
2727
- `mlab.stineman_interp`
28+
- `mlab.segments_intersect`
2829
- `mlab.donothing_callback`

lib/matplotlib/mlab.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,33 +1194,6 @@ def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
11941194
return Cxy, f
11951195

11961196

1197-
@cbook.deprecated('2.2')
1198-
def segments_intersect(s1, s2):
1199-
"""
1200-
Return *True* if *s1* and *s2* intersect.
1201-
*s1* and *s2* are defined as::
1202-
1203-
s1: (x1, y1), (x2, y2)
1204-
s2: (x3, y3), (x4, y4)
1205-
"""
1206-
(x1, y1), (x2, y2) = s1
1207-
(x3, y3), (x4, y4) = s2
1208-
1209-
den = ((y4-y3) * (x2-x1)) - ((x4-x3)*(y2-y1))
1210-
1211-
n1 = ((x4-x3) * (y1-y3)) - ((y4-y3)*(x1-x3))
1212-
n2 = ((x2-x1) * (y1-y3)) - ((y2-y1)*(x1-x3))
1213-
1214-
if den == 0:
1215-
# lines parallel
1216-
return False
1217-
1218-
u1 = n1/den
1219-
u2 = n2/den
1220-
1221-
return 0.0 <= u1 <= 1.0 and 0.0 <= u2 <= 1.0
1222-
1223-
12241197
@cbook.deprecated('2.2')
12251198
def fftsurr(x, detrend=detrend_none, window=window_none):
12261199
"""

lib/matplotlib/pylab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
l2norm, log2, movavg, norm_flat,
238238
path_length, poly_below, poly_between,
239239
rec2csv, rec_append_fields, rec_drop_fields, rec_join, rms_flat,
240-
segments_intersect, vector_lengths,
240+
vector_lengths,
241241
window_hanning, window_none)
242242

243243
from matplotlib import cbook, mlab, pyplot as plt

0 commit comments

Comments
 (0)