Skip to content

Commit 0aaf640

Browse files
committed
Replaced sqrt(x**2+y**2) with hypot in PathPlanning/BezierPath/bezier_path.py
1 parent 1fcfa72 commit 0aaf640

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PathPlanning/BezierPath/bezier_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def calc_4points_bezier_path(sx, sy, syaw, ex, ey, eyaw, offset):
2626
:param offset: (float)
2727
:return: (numpy array, numpy array)
2828
"""
29-
dist = np.sqrt((sx - ex) ** 2 + (sy - ey) ** 2) / offset
29+
dist = np.hypot(sx - ex, sy - ey) / offset
3030
control_points = np.array(
3131
[[sx, sy],
3232
[sx + dist * np.cos(syaw), sy + dist * np.sin(syaw)],

0 commit comments

Comments
 (0)