Skip to content

Commit

Permalink
required changes in math-functions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ultrainstinct30 committed May 28, 2019
1 parent 0435b5c commit 74f50a4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions utils/math_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def intersection_with_line(self, line2):
P.y = (m1 * c2 - m2 * c1) / (m1 - m2)
except:
return None
return P
##
# @brief Find Prependicular distance of point from line
# https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line
Expand Down Expand Up @@ -205,8 +206,8 @@ def direction(vector):


def getPointBehindTheBall(point, theta):
x = point.x - (3.5 * BOT_RADIUS) * (math.cos(theta))
y = point.y - (3.5 * BOT_RADIUS) * (math.sin(theta))
x = point.x + (3.5 * BOT_RADIUS) * (math.cos(theta))
y = point.y + (3.5 * BOT_RADIUS) * (math.sin(theta))
return Vector2D(int(x), int(y))

def getPointToGo(point, theta):
Expand Down Expand Up @@ -238,10 +239,10 @@ def stan_inverse(self,y,x):
return atan2(y,x)+3.14159265


def getPointBehindTheBall(point ,theta):
x = point.x -(3.5 * BOT_RADIUS) *(math.cos(theta))
y = point.y -(3.5 * BOT_RADIUS) *(math.sin(theta))
return Vector2D(int(x), int(y))
# def getPointBehindTheBall(point ,theta):
# x = point.x +(3.5 * BOT_RADIUS) *(math.cos(theta))
# y = point.y +(3.5 * BOT_RADIUS) *(math.sin(theta))
# return Vector2D(int(x), int(y))

def vicinity_points(point1, point2, thresh=10):
return dist(point1, point2) < thresh
Expand Down

0 comments on commit 74f50a4

Please sign in to comment.