Skip to content

Commit a26583f

Browse files
authored
Merge pull request #68 from ultrainstinct30/VariableThresh
Variable threshold of getPointBehindTheBall
2 parents 6031170 + 1bcd93a commit a26583f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

utils/math_functions.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ def direction(vector):
211211
return math.atan2(vector.y, vector.x)
212212

213213

214-
def getPointBehindTheBall(point, theta):
215-
x = point.x - (3.5 * BOT_RADIUS) * (math.cos(theta))
216-
y = point.y - (3.5 * BOT_RADIUS) * (math.sin(theta))
214+
def getPointBehindTheBall(point, theta, factor=3.5):
215+
x = point.x + (factor * BOT_RADIUS) * (math.cos(theta))
216+
y = point.y + (factor * BOT_RADIUS) * (math.sin(theta))
217217
return Vector2D(int(x), int(y))
218218

219219
def getPointToGo(point, theta):
@@ -244,12 +244,6 @@ def stan_inverse(self,y,x):
244244
else:
245245
return atan2(y,x)+3.14159265
246246

247-
248-
def getPointBehindTheBall(point ,theta, factor=3.5):
249-
x = point.x +(factor * BOT_RADIUS) *(math.cos(theta))
250-
y = point.y +(factor * BOT_RADIUS) *(math.sin(theta))
251-
return Vector2D(int(x), int(y))
252-
253247
def vicinity_points(point1, point2, thresh=10):
254248
return dist(point1, point2) < thresh
255249

0 commit comments

Comments
 (0)