mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-04-22 03:00:22 -04:00
Replaced sqrt(x**2+y**2) with hypot in Mapping/gaussian_grid_map/gaussian_grid_map.py
This commit is contained in:
@@ -31,7 +31,7 @@ def generate_gaussian_grid_map(ox, oy, xyreso, std):
|
||||
# Search minimum distance
|
||||
mindis = float("inf")
|
||||
for (iox, ioy) in zip(ox, oy):
|
||||
d = math.sqrt((iox - x)**2 + (ioy - y)**2)
|
||||
d = math.hypot(iox - x, ioy - y)
|
||||
if mindis >= d:
|
||||
mindis = d
|
||||
|
||||
|
||||
Reference in New Issue
Block a user