Skip to content

Commit 72a28b4

Browse files
committed
Replaced sqrt(x**2+y**2) with hypot in Mapping/rectangle_fitting/rectangle_fitting.py
1 parent 0aaf640 commit 72a28b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Mapping/rectangle_fitting/rectangle_fitting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def _adoptive_range_segmentation(self, ox, oy):
162162
C = set()
163163
R = self.R0 + self.Rd * np.linalg.norm([ox[i], oy[i]])
164164
for j, _ in enumerate(ox):
165-
d = np.sqrt((ox[i] - ox[j])**2 + (oy[i] - oy[j])**2)
165+
d = np.hypot(ox[i] - ox[j], oy[i] - oy[j])
166166
if d <= R:
167167
C.add(j)
168168
S.append(C)

0 commit comments

Comments
 (0)