k-d tree with rectangles
<p>I've got my implementation of a k-d tree working with given points. For example, I can add points to the tree and then find the nearest point to given x, y coordinates, which is great.</p>

<p>I want to extend this to work with rectangles, for example a user gives an x and a y coordinate, a width and a height, I then want to be able to do a range query and nearest neighbour searches on this structure. How would I go about extending the current tree that I had to work with rectangular data?</p>
