Replaced sqrt(x**2+y**2) with hypot in Mapping/rectangle_fitting/rectangle_fitting.py

This commit is contained in:
Guillaume Jacquenot
2019-12-07 22:31:05 +01:00
parent 0aaf6406d8
commit 72a28b4d4b

View File

@@ -162,7 +162,7 @@ class LShapeFitting():
C = set()
R = self.R0 + self.Rd * np.linalg.norm([ox[i], oy[i]])
for j, _ in enumerate(ox):
d = np.sqrt((ox[i] - ox[j])**2 + (oy[i] - oy[j])**2)
d = np.hypot(ox[i] - ox[j], oy[i] - oy[j])
if d <= R:
C.add(j)
S.append(C)