Top view: splits, neighbours, search circle
Work per query vs catalogue size

K-d Tree Nearest-Neighbour Star Catalogue Search: Top View and Work Scaling (2D)

Finding the stars nearest to a telescope pointing among thousands of catalogue entries is a classic spatial-search problem. A k-d tree splits the star box by planes and skips every branch the search sphere cannot reach, so it examines a few dozen stars instead of all of them. Choose the catalogue size, star distribution, number of neighbours and a range radius, and watch a Blender-built refractor follow a moving pointing while the tree and brute force race. Checked against brute force, the Poisson nearest-neighbour distance and median, the tree depth floor(log2 N)+1 and logarithmic scaling.

Made with 🟠 Blender