https://github.com/codeandcats/kdtree
A fast, generic, multi-dimensional Binary Search Tree written in C#
https://github.com/codeandcats/kdtree
Last synced: about 1 year ago
JSON representation
A fast, generic, multi-dimensional Binary Search Tree written in C#
- Host: GitHub
- URL: https://github.com/codeandcats/kdtree
- Owner: codeandcats
- License: mit
- Created: 2013-11-26T22:20:29.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2020-06-25T11:01:19.000Z (about 6 years ago)
- Last Synced: 2025-04-03T11:11:14.316Z (about 1 year ago)
- Language: C#
- Size: 52.7 KB
- Stars: 255
- Watchers: 11
- Forks: 88
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
KdTree
======
A fast, generic, and multi-dimensional Binary Search Tree written in C#.
# Install
Install via NuGet Package Manager Console:
```
PM> Install-Package KdTree
```
# Examples
## Find nearest point in two dimensions
```cs
var tree = new KdTree(2, new FloatMath());
tree.Add(new[] { 50.0f, 80.0f }, 100);
tree.Add(new[] { 20.0f, 10.0f }, 200);
var nodes = tree.GetNearestNeighbours(new[] { 30.0f, 20.0f }, 1);
```