Skip to content

Commit f66a10f

Browse files
committed
Replaced sqrt(x**2+y**2) with hypot in Localization/histogram_filter/histogram_filter.py
1 parent 4545084 commit f66a10f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Localization/histogram_filter/histogram_filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def observation(xTrue, u, RFID):
126126

127127
dx = xTrue[0, 0] - RFID[i, 0]
128128
dy = xTrue[1, 0] - RFID[i, 1]
129-
d = math.sqrt(dx ** 2 + dy ** 2)
129+
d = math.hypot(dx, dy)
130130
if d <= MAX_RANGE:
131131
# add noise to range observation
132132
dn = d + np.random.randn() * NOISE_RANGE

0 commit comments

Comments
 (0)