Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want to keep with scipy, you have to convex hull (you did so)</p> <pre><code>&gt;&gt;&gt; from scipy.spatial import ConvexHull &gt;&gt;&gt; points = np.random.rand(30, 2) # 30 random points in 2-D &gt;&gt;&gt; hull = ConvexHull(points) </code></pre> <p>then build the list of points on the hull. Here is the code from doc to plot the hull</p> <pre><code>&gt;&gt;&gt; import matplotlib.pyplot as plt &gt;&gt;&gt; plt.plot(points[:,0], points[:,1], 'o') &gt;&gt;&gt; for simplex in hull.simplices: &gt;&gt;&gt; plt.plot(points[simplex,0], points[simplex,1], 'k-') </code></pre> <p>So starting from that, I would propose for computing list of points on the hull</p> <pre><code>pts_hull = [(points[simplex,0], points[simplex,1]) for simplex in hull.simplices] </code></pre> <p>(although i did not try)</p> <p>And you can also come with your own code for computing the hull, returning the x,y points. </p> <p><strong>If you want to know if a point from your original dataset is on the hull</strong>, then you are done.</p> <p><strong>I what you want is to know if a any point is inside the hull or outside</strong>, you must do a bit of work more. What you will have to do could be</p> <ul> <li><p>for all edges joining two simplices of your hull: decide whether your point is above or under</p></li> <li><p>if point is below all lines, or above all lines, it is outside the hull</p></li> </ul> <p>As a speed up, as soon as a point has been above one line and below one another, it is inside the hull.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload