Guest User

Untitled

a guest
Sep 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. def isInHull(P,hull):
  2. '''
  3. Datermine if the list of points P lies inside the hull
  4. :return: list
  5. List of boolean where true means that the point is inside the convex hull
  6. '''
  7. A = hull.equations[:,0:-1]
  8. b = np.transpose(np.array([hull.equations[:,-1]]))
  9. isInHull = np.all((A @ np.transpose(P)) <= np.tile(-b,(1,len(P))),axis=0)
  10.  
  11. hull = ConvexHull(X)
Add Comment
Please, Sign In to add comment