I have n points on a unit sphere (n up to 10^9). I need to find nearest approximations of these points by n_samples Fibonacci sphere points (n_samples in my case is 65536).
I.e. for each input point, I need to find index i_sample of the nearest Fibonacci point.
What's a good way to do it in less than O(n * n_samples) operations?
One approach is to use a KD-tree data structure to efficiently search for the nearest neighbor in the set of Fibonacci sphere points
Here is a sample algorithm to do this: