Skip to content

Commit 06cbcc3

Browse files
committed
Replaced sqrt(x**2+y**2) with hypot in PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py
1 parent 5221a9d commit 06cbcc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def find_sweep_direction_and_start_posi(ox, oy):
118118
for i in range(len(ox) - 1):
119119
dx = ox[i + 1] - ox[i]
120120
dy = oy[i + 1] - oy[i]
121-
d = np.sqrt(dx ** 2 + dy ** 2)
121+
d = np.hypot(dx, dy)
122122

123123
if d > max_dist:
124124
max_dist = d

0 commit comments

Comments
 (0)