0

I have a set of points (10000 - 15000). For each point, I know the coordinates (X,Y). For any generic P point I want to determine the four points that shape a quadrilateral around P, like in figure [figure 1]

I tried to calculate the distance between P and the other points and pick up the nearest ones, but this method doesn't work everytime because the points haven't a regular dislocation. It happens something like in figure below [figure 2]

engpav
  • 1
  • 2
  • You need to tell us more about what counts as "the four points that shape a quadrilateral around P". For example, in your second picture, what's wrong with choosing the same bottom two points you have, the 'd2' point, and the same top-left point you have? Those four make "a quadrilateral around P"... – AakashM Feb 25 '16 at 11:46

1 Answers1

0

Build Delaunay triangulation of point set.

Make some data structure to quickly find a triangle for given point. I think that R-tree with bounding rectangles for every triangle is a good choice.

When triangle is found, search for its neighbors to build the best quadrilateral

MBo
  • 77,366
  • 5
  • 53
  • 86