In this project, I have used K-D tree data structure to search and find nearest object in the list of Asteroids for Asteroids object and draw a red line between them.
In computer science, a k-d tree (short for k-dimensional tree) is a space-partitioning data structure for organising points in a k-dimensional space. k-d trees are a useful data structure for several applications, such as searches involving a multidimensional search key (e.g. range searches and nearest neighbour searches). k-d trees are a special case of binary space partitioning trees.