Fast algorithm to find the x closest points to a given point on a plane

后端 未结 4 596
猫巷女王i
猫巷女王i 2020-12-05 11:59

I would like to find a fast algorithm in order to find the x closest points to a given point on a plane.

We are actually dealing with not too many points (between 1

4条回答
  •  渐次进展
    2020-12-05 12:31

    What you need is a data structure appropriate for organizing points in a plane. The K-D-Tree is often used in such situations. See k-d tree on Wikipedia.

    Here, I found a general description of Geometric Algorithms


    UPDATE

    I ported a Java implementation of a KD-tree to C#. Please see User:Ojd/KD-Tree on RoboWiki. You can download the code there or you can download CySoft.Collections.zip directly from my homepage (only download, no docu).

提交回复
热议问题