class Kd::Tree(T)
- Kd::Tree(T)
- Reference
- Object
Overview
A generic KD-tree implementation where T
is the type of the points.
Defined in:
kd_tree.crConstructors
-
.new(points : Array(T))
Constructor for the KD-tree.
Instance Method Summary
-
#nearest(target : T, n : Int32 = 1) : Array(T)
Method to find the nearest 'n' points to a given target point.
- #root : Node(T) | Nil
Constructor Detail
def self.new(points : Array(T))
#
Constructor for the KD-tree. Takes an array of points of type T and builds the tree.
Instance Method Detail
def nearest(target : T, n : Int32 = 1) : Array(T)
#
Method to find the nearest 'n' points to a given target point. Returns an array of these points.