What is the fastest way to find the closest point to a given point?

后端 未结 9 2124
情歌与酒
情歌与酒 2020-11-28 07:18

What is the fastest way to find closest point to the given point in data array?

For example, suppose I have an array A of 3D points (with coordinates x,

9条回答
  •  时光取名叫无心
    2020-11-28 07:41

    Its my understanding quadtree is for 2d, but you could calculate something for 3d thats is very similar. This will speed up your search, but it will require much more time to calculate the index if done on the fly. I would suggest calculating the index once then storing it. On every lookup you figure out all of the exterior quads then work your way in looking for hits... it would look like pealing an orange. The speed will greatly increase as the quads get smaller. Everything has a trade off.

提交回复
热议问题