title: An algorithm for efficient mapping of points to polygons
body: <p>I'm working on R on the following problem.</p>
  
  <p>I have a set of polygons defined by their vertices (x and y coordinates).</p>
  
  <p>I also have a set of points (with given x and y coordinate), and I need an efficient algorithm which would assign each point to each polygon with some probability.</p>
  
  <p>One algorithm, for example, could be testing the distances of the test point from the centroid of each polygon - and the smaller the distance, the higher the probability of that point being in the polygon.</p>
  
  <p>Any other ideas / enhancements to the above idea would be appreciated.</p>