Google has a KD Tree Library written in C: Here
As far as I can tell, you insert notes into the tree using one of it's functions, and then query the tree for nearest neighbors. It returns a pointer to a new array (as far as I can tell).
Here is my goal:
I have a 3D array and I am hoping to find a way to return the index of a given point's nearest neighbor. I want to say: Here is a point: (12,23,14), now tell me the index of the point that is closest ex: "it is the 5th item in your array". However, I am not sure how to do this.
My Questions, Does anyone:
A) Know of a good well documented k dimensional nearest neighbor search library for c, or:
B) Know how to get Google's code to return the position of the nearest neighbor in an array.