A k-d tree organizes a given set of points in three-dimensional space. It is used to search quickly for the point nearest to a given point.
A maxon::KDTree is simply created with:
The tree is filled with:
The nearest point for a given point in space can be found with: