An open API service indexing awesome lists of open source software.

https://github.com/hamolicious/quad-tree

Quad Tree Partitioning system written in and for Python
https://github.com/hamolicious/quad-tree

python quadtree

Last synced: about 2 months ago
JSON representation

Quad Tree Partitioning system written in and for Python

Awesome Lists containing this project

README

        

# Quad-Tree
Quad Tree Partitioning system written in and for Python

- [x] Supports AABB and Circle querying

## Usage
```python

from quadtree import AABB, Tree, Point, Circle

# define position and size of the tree
tree = Tree(Vec2d.zero(), size)
# define position and radius
shape = Circle(mouse_pos, 10)

# create and insert a point into the tree
p = Point(mouse_pos)
tree.insert(p)

# returns points inside the shape
points = tree.query(shape)

```