mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-01-13 19:48:02 -05:00
Replaced sqrt(x**2+y**2) with hypot in PathPlanning/FrenetOptimalTrajectory/frenet_optimal_trajectory.py
This commit is contained in:
@@ -230,7 +230,7 @@ def calc_global_paths(fplist, csp):
|
||||
dx = fp.x[i + 1] - fp.x[i]
|
||||
dy = fp.y[i + 1] - fp.y[i]
|
||||
fp.yaw.append(math.atan2(dy, dx))
|
||||
fp.ds.append(math.sqrt(dx**2 + dy**2))
|
||||
fp.ds.append(math.hypot(dx, dy))
|
||||
|
||||
fp.yaw.append(fp.yaw[-1])
|
||||
fp.ds.append(fp.ds[-1])
|
||||
|
||||
Reference in New Issue
Block a user