Skip to content

Commit c3ffc08

Browse files
committed
use built-in function for norm
1 parent 67630e5 commit c3ffc08

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

PathPlanning/ThetaStar/theta_star.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def planning(self, sx, sy, gx, gy):
9999
dy = py - y
100100

101101
# scale down vector for visibility
102-
norm = math.sqrt(dx*dx + dy*dy)
102+
norm = math.hypot(dx, dy)
103103
dx /= norm
104104
dy /= norm
105105

0 commit comments

Comments
 (0)