Advertisement
Guest User

get radius function

a guest
Aug 15th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. def calculate_radius(point1, point2, timedelta = 1.0):
  2.     if point1 is None:
  3.         p1 = np.array([0.0,0.0])
  4.     else:
  5.         p1 = np.array(point1)
  6.     p2 = np.array(point2)
  7.     dist = np.linalg.norm(p2-p1)
  8.     radius = (dist/timedelta)
  9.     return int(radius)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement