From 06cbcc3ee55598f54b612c2f842cfb052f8b751e Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 7 Dec 2019 22:22:14 +0100 Subject: [PATCH] Replaced sqrt(x**2+y**2) with hypot in PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py --- .../GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py b/PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py index f22b058f..9d7e1616 100644 --- a/PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py +++ b/PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py @@ -118,7 +118,7 @@ def find_sweep_direction_and_start_posi(ox, oy): for i in range(len(ox) - 1): dx = ox[i + 1] - ox[i] dy = oy[i + 1] - oy[i] - d = np.sqrt(dx ** 2 + dy ** 2) + d = np.hypot(dx, dy) if d > max_dist: max_dist = d