python - Check if points lies inside a convex hull -


i making convex hull using scipy.spatial package http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.convexhull.html#scipy.spatial.convexhull

i've tried searching, have yet know if there easy way find if point (latitude/longitude) lies inside convex hull. suggestions?

the method i've used before using path class matplotlib. has contains_point method that. contains_points allows query array of points.

to use do

from scipy.spatial import convexhull matplotlib.path import path  hull = convexhull( points )  hull_path = path( points[hull.vertices] )  print hull_path.contains_point((1,2)) # (1,2) in convex hull? 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -