Skip to content

Instantly share code, notes, and snippets.

@sachaarbonel
Created November 5, 2022 21:21
Show Gist options
  • Save sachaarbonel/8cbd975bf5b8f56ac8fcdddc6773ad0e to your computer and use it in GitHub Desktop.
Save sachaarbonel/8cbd975bf5b8f56ac8fcdddc6773ad0e to your computer and use it in GitHub Desktop.
let kdtree = kd_tree::KdTree::build_by_ordered_float(vec![
[1.0, 2.0, 3.0],
[3.0, 1.0, 2.0],
[2.0, 3.0, 1.0],
]);
// search the nearest neighbor
let found = kdtree.nearest(&[3.1, 0.9, 2.1]).unwrap();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment