Skip to content

Commit 0771202

Browse files
committed
Replaced sqrt(x**2+y**2) with hypot in PathPlanning/FrenetOptimalTrajectory/frenet_optimal_trajectory.py
1 parent 60387ee commit 0771202

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PathPlanning/FrenetOptimalTrajectory/frenet_optimal_trajectory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def calc_global_paths(fplist, csp):
230230
dx = fp.x[i + 1] - fp.x[i]
231231
dy = fp.y[i + 1] - fp.y[i]
232232
fp.yaw.append(math.atan2(dy, dx))
233-
fp.ds.append(math.sqrt(dx**2 + dy**2))
233+
fp.ds.append(math.hypot(dx, dy))
234234

235235
fp.yaw.append(fp.yaw[-1])
236236
fp.ds.append(fp.ds[-1])

0 commit comments

Comments
 (0)