Open MrYang614 opened 10 months ago
const points = [{ 'y': 2, 'x': 110 }, { 'y': 2, 'x': 222 }, { 'y': 2, 'x': 333 }, { 'y': 2, 'x': 444 }, { 'y': 2, 'x': 555 }, { 'y': 2, 'x': 666 }, { 'y': 2, 'x': 777 }, { 'y': 2, 'x': 888 }, { 'y': 2, 'x': 999 }, { 'y': 2, 'x': 1110 }]
R = 1000
const tree = new kdTree([...points], distance, ["x", "z"]); const obj = {}; const nearest = tree.nearest(points[0], 10, R);
// const nearest = tree.nearest(point[points.length-1],10,R)
In a line points , the first point and the last point , get the error data
const points = [{ 'y': 2, 'x': 110 }, { 'y': 2, 'x': 222 }, { 'y': 2, 'x': 333 }, { 'y': 2, 'x': 444 }, { 'y': 2, 'x': 555 }, { 'y': 2, 'x': 666 }, { 'y': 2, 'x': 777 }, { 'y': 2, 'x': 888 }, { 'y': 2, 'x': 999 }, { 'y': 2, 'x': 1110 }]
R = 1000
// const nearest = tree.nearest(point[points.length-1],10,R)
In a line points , the first point and the last point , get the error data