Exemplo n.º 1
0
        public void TestGetNearestPoint()
        {
            var root  = new Node(2);
            var query = new Point(new double[] { 1, 2 });

            var points = new List <Point> {
                new Point(new double[] { 2, 3 }),
                new Point(new double[] { 12, 6 }),
                new Point(new double[] { 60, 27 }),
                new Point(new double[] { 211, 90 })
            };

            root.Insert(points);

            var nearest = root.GetNearestPoint(query);

            Assert.AreEqual(points[1], nearest);
        }