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
- Host: GitHub
- URL: https://github.com/hamolicious/quad-tree
- Owner: hamolicious
- License: wtfpl
- Created: 2021-12-19T05:36:00.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-19T05:45:40.000Z (over 3 years ago)
- Last Synced: 2025-01-07T05:25:55.761Z (4 months ago)
- Topics: python, quadtree
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Quad-Tree
Quad Tree Partitioning system written in and for Python- [x] Supports AABB and Circle querying
## Usage
```pythonfrom 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)```