Skip to content

Commit 4c73cad

Browse files
committed
Replaced sqrt(x**2+y**2) with hypot in PathPlanning/CubicSpline/cubic_spline_planner.py
1 parent cf53875 commit 4c73cad

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

PathPlanning/CubicSpline/cubic_spline_planner.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ def __init__(self, x, y):
140140
def __calc_s(self, x, y):
141141
dx = np.diff(x)
142142
dy = np.diff(y)
143-
self.ds = [math.sqrt(idx ** 2 + idy ** 2)
144-
for (idx, idy) in zip(dx, dy)]
143+
self.ds = np.hypot(dx, dy)
145144
s = [0]
146145
s.extend(np.cumsum(self.ds))
147146
return s

0 commit comments

Comments
 (0)