When dividing the rectangle, now its child-points will be moved to the new child-rectangles #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why?
Reason number 1
Imagine a QuadTree with a capacity of 1.


When you insert a point, everything's fine, right?
But if you add a second point, the tree will probably look like this:
Because the red point is counted as a child of the top-right rectangle, while the black point is still counted as a child of the big main rectangle. So that's you would visually see these two points in the same rectangle. Remember that the capacity of this tree is 1. For me, it looks pretty wrong.
Reason number 2
Now in the query() function, the loop runs only on the smallest squares (that are not divided), I believe this increases the searching performance.