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

后端 未结 9 2150
情歌与酒
情歌与酒 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:38

    The "Fastest" way to do it, considering the search ONLY, would be to use voxels. With a 1:1 point-voxel map, the access time is constant and really fast, just shift the coordinates to center your point origin at the voxel origin(if needed) and then just round-down the position and access the voxel array with that value. For some cases, this is a good choice. As explained before me, octrees are better when a 1:1 map is hard to get( too much points, too little voxel resolution, too much free space).

提交回复
热议问题