Note that there are some explanatory texts on larger screens.

plurals
  1. POTest point for its position relative to the convex hull in log(n)
    primarykey
    data
    text
    <p>I have a collection of 2D points <code>S</code> and I need to test if an input point <code>q</code> is inside or outside the convex hull of <code>S</code>.</p> <p>Since it's about a binary decision, I was thinking I could theoretically achieve <code>O(log(N))</code> by using a decision tree.</p> <p>However I have no idea how to organize the data and how the algorithm would look like to really get an answer in <code>O(log(N))</code>.</p> <p>While researching with this idea in mind, I've found this:</p> <blockquote> <p>How can we find these two cases more quickly? Binary search. Just search for x in the first coordinates of points in the two chains. If it is in the chain, you have found a crossing through a vertex (and you don't have to be as careful to tell what kind of crossing, either). If x is not the coordinate of a vertex in the chain, the two nearest values to it tell you which segment the ray from (x,y) might cross. So we can test whether a point is in a convex polygon in time <strong>O(log n)</strong>.</p> <p>It turns out that there are <strong>data structures</strong> that can test whether a point is in an arbitrary polygon (or which of several polygons it's in) in the same <strong>O(log n)</strong> time bound. But they're more complicated, so I don't have time to describe them here; I'll talk about them at some point in ICS 164.</p> </blockquote> <p>(<a href="http://www.ics.uci.edu/~eppstein/161/960307.html">http://www.ics.uci.edu/~eppstein/161/960307.html</a>)</p> <p>So do you have any ideas:</p> <ol> <li>How the data structure should look like to get it down in <code>O(log(N))</code>?</li> <li>How the algorithm should look like?</li> </ol>
    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.
 

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