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

This commit is contained in:
Guillaume Jacquenot
2019-12-07 22:53:07 +01:00
parent ccf047135e
commit 1273934a7e

View File

@@ -57,7 +57,7 @@ def precasting(minx, miny, xw, yw, xyreso, yawreso):
px = ix * xyreso + minx
py = iy * xyreso + miny
d = math.sqrt(px**2 + py**2)
d = math.hypot(px, py)
angle = atan_zero_to_twopi(py, px)
angleid = int(math.floor(angle / yawreso))
@@ -85,7 +85,7 @@ def generate_ray_casting_grid_map(ox, oy, xyreso, yawreso):
for (x, y) in zip(ox, oy):
d = math.sqrt(x**2 + y**2)
d = math.hypot(x, y)
angle = atan_zero_to_twopi(y, x)
angleid = int(math.floor(angle / yawreso))