We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc2b7c9 commit 26cff8eCopy full SHA for 26cff8e
PathPlanning/RRT/rrt.py
@@ -126,7 +126,7 @@ def generate_final_course(self, goal_ind):
126
def calc_dist_to_goal(self, x, y):
127
dx = x - self.end.x
128
dy = y - self.end.y
129
- return math.sqrt(dx ** 2 + dy ** 2)
+ return math.hypot(dx, dy)
130
131
def get_random_node(self):
132
if random.randint(0, 100) > self.goal_sample_rate:
@@ -186,7 +186,7 @@ def check_collision(node, obstacleList):
186
def calc_distance_and_angle(from_node, to_node):
187
dx = to_node.x - from_node.x
188
dy = to_node.y - from_node.y
189
- d = math.sqrt(dx ** 2 + dy ** 2)
+ d = math.hypot(dx, dy)
190
theta = math.atan2(dy, dx)
191
return d, theta
192
0 commit comments