Utilities¶
-
quads.
visualize
(tree, size=10)¶ Using matplotlib, generates a visualization of the QuadTree.
You will have to separately install matplotlib, as this library does not depend on it in any other way:
$ pip install matplotlib
Once installed, this will automatically generate an entire plot of all the points within, as well as lines for the subdivisions of nodes.
Parameters: - tree (QuadTree) – The quadtree itself.
- size (int) – The size of the resulting output diagram.
-
quads.
euclidean_distance
(ref_point, check_point)¶ Calculates a euclidean distance between points.
Parameters: Returns: The (unitless) distance value.
Return type: int|float
-
quads.
euclidean_compare
(ref_point, check_point)¶ Calculates a raw euclidean value for comparison with other raw values.
This calculates the sum of the delta of X values plus the delta of Y values. It skips the square root portion of the Pythagorean theorem, for speed.
If you need a proper euclidean distance value, see euclidean_distance.
Primarily for internal use, but stable API if you need it.
Parameters: Returns: The sum value.
Return type: int|float