0

Possible Duplicates:
which data structure is appropriate to query “all points within distance d from point p”
Storing objects for locating by x,y coordinates

I have a list of items, each with a location in 2D space (specified using euclidean geometry, i.e. as an (x, y) coordinate pair).

How should I store this list (e.g. hashtable? etc...) to allow myself to be able to efficiently look up all items in that list that are within a distance D of some point (x, y)?

(Again, I'm talking about simple straight line distance i.e. d ^ 2 = dx ^ 2 + dy ^ 2)

Community
  • 1
  • 1
Justin
  • 82,493
  • 48
  • 216
  • 356
  • 1
    IN the related side bar I see [which data structure is appropriate to query “all points within distance d from point p”](http://stackoverflow.com/questions/1318595/which-data-structure-is-appropriate-to-query-all-points-within-distance-d-from-p) which appears to be a duplicate. Comment? H...Novelocrat's answer points to some more similar questions. – dmckee --- ex-moderator kitten Sep 02 '10 at 02:01
  • @dmckee - Thanks, both of those questions are really useful (I don't understand why they weren't shown in the list of similar questions when I asked my question however) – Justin Sep 02 '10 at 02:12

0 Answers0