All Projects β†’ arl β†’ golq

arl / golq

Licence: MIT license
πŸ“‘ 2D locality queries in Go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to golq

Leaflet.layergroup.collision
Leaflet plugin for uncluttering L.Markers using basic collision detection.
Stars: ✭ 82 (+192.86%)
Mutual labels:  collision-detection
DAABBCC
Dynamic AABB Tree native extension with Branch and Bound Algorithm for Defold Engine
Stars: ✭ 42 (+50%)
Mutual labels:  collision-detection
intersection-wasm
Mesh-Mesh and Triangle-Triangle Intersection tests based on the algorithm by Tomas Akenine-MΓΆller
Stars: ✭ 17 (-39.29%)
Mutual labels:  collision-detection
Collision Rs
A collision extension to cgmath
Stars: ✭ 101 (+260.71%)
Mutual labels:  collision-detection
Aabbcc
Dynamic AABB trees in C++ with support for periodic systems.
Stars: ✭ 204 (+628.57%)
Mutual labels:  collision-detection
ufomap
UFOMap: An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Stars: ✭ 117 (+317.86%)
Mutual labels:  collision-detection
Reactphysics3d
Open source C++ physics engine library in 3D
Stars: ✭ 730 (+2507.14%)
Mutual labels:  collision-detection
csb
A cloth and soft body simulation library, using position based dynamics.
Stars: ✭ 29 (+3.57%)
Mutual labels:  collision-detection
Cupoch
Robotics with GPU computing
Stars: ✭ 225 (+703.57%)
Mutual labels:  collision-detection
3D interactive graphics rendering engine
Develop a 3D interactive graphics rendering engine
Stars: ✭ 31 (+10.71%)
Mutual labels:  collision-detection
Discregrid
A static C++ library for the generation of discrete functions on a box-shaped domain. This is especially suited for the generation of signed distance fields.
Stars: ✭ 153 (+446.43%)
Mutual labels:  collision-detection
Collisiondetection
A book and examples on collision detection
Stars: ✭ 202 (+621.43%)
Mutual labels:  collision-detection
exengine
A C99 3D game engine
Stars: ✭ 487 (+1639.29%)
Mutual labels:  collision-detection
Spatial Collision Datastructures
Benchmark of various spatial data structures for collision detection.
Stars: ✭ 96 (+242.86%)
Mutual labels:  collision-detection
Libbulletjme
A JNI interface to Bullet Physics and V-HACD
Stars: ✭ 55 (+96.43%)
Mutual labels:  collision-detection
Rappids
Rectangular Pyramid Partitioning using Integrated Depth Sensors (RAPPIDS): A Fast Planner for Multicopter Navigation
Stars: ✭ 17 (-39.29%)
Mutual labels:  collision-detection
SSCD.js
Super Simple Collision Detection for JavaScript games!
Stars: ✭ 88 (+214.29%)
Mutual labels:  collision-detection
blog
I wonder how~, I wonder why~
Stars: ✭ 30 (+7.14%)
Mutual labels:  collision-detection
parry
2D and 3D collision-detection library for Rust.
Stars: ✭ 267 (+853.57%)
Mutual labels:  collision-detection
BoxPruning
Broad-phase optimizations.
Stars: ✭ 45 (+60.71%)
Mutual labels:  collision-detection

golq : 2D Locality Queries

Build Status codecov pkg.go.dev

2D locality queries in Go

This utility is a spatial database which stores objects each of which is associated with a 2D point (a location in a 2D space). The points serve as the search key for the associated object. It is intended to efficiently answer circle inclusion queries, also known as range queries, basically questions like:

Which objects are within a radius R of the location L?

In this context, efficiently means significantly faster than the naive, brute force O(n) testing of all known points. Additionally it is assumed that the objects move along unpredictable paths, so that extensive preprocessing (for example, constructing a Delaunay triangulation of the point set) may not be practical.

The implementation is a bin lattice: a 2D rectangular array of brick-shaped (rectangles) regions of space. Each region is represented by a pointer to a (possibly empty) doubly-linked list of objects. All of these sub-bricks are the same size. All bricks are aligned with the global coordinate axes.

Usage example

TODO

Benchmarks

benchmark image

This logarithmic scale plot shows the numbers obtained in the following benchmarks. The brute-force method computes squared distances between every object and the randomly chosen search query point. It doesn't even include the additional time that would be taken to sort them in order to extract the nearest (or K nearest).

BenchmarkBruteForce10-2                          2000000               819 ns/op
BenchmarkBruteForce50-2                           500000              3570 ns/op
BenchmarkBruteForce100-2                          200000              6958 ns/op
BenchmarkBruteForce200-2                          100000             13564 ns/op
BenchmarkBruteForce500-2                           50000             33037 ns/op
BenchmarkBruteForce1000-2                          20000             66053 ns/op
BenchmarkNearestNeighbourLq10Radius2-2           3000000               546 ns/op
BenchmarkNearestNeighbourLq50Radius2-2           2000000               788 ns/op
BenchmarkNearestNeighbourLq100Radius2-2          1000000              1025 ns/op
BenchmarkNearestNeighbourLq200Radius2-2          1000000              1434 ns/op
BenchmarkNearestNeighbourLq500Radius2-2           500000              2431 ns/op
BenchmarkNearestNeighbourLq1000Radius2-2          300000              4242 ns/op
BenchmarkNearestNeighbourLq10Radius4-2           2000000               987 ns/op
BenchmarkNearestNeighbourLq50Radius4-2           1000000              1480 ns/op
BenchmarkNearestNeighbourLq100Radius4-2          1000000              1985 ns/op
BenchmarkNearestNeighbourLq200Radius4-2           500000              2974 ns/op
BenchmarkNearestNeighbourLq500Radius4-2           300000              5427 ns/op
BenchmarkNearestNeighbourLq1000Radius4-2          200000              9927 ns/op
BenchmarkObjectsInLocalityLq10Radius2-2          3000000               410 ns/op
BenchmarkObjectsInLocalityLq50Radius2-2          3000000               570 ns/op
BenchmarkObjectsInLocalityLq100Radius2-2         2000000               731 ns/op
BenchmarkObjectsInLocalityLq200Radius2-2         1000000              1051 ns/op
BenchmarkObjectsInLocalityLq500Radius2-2         1000000              1854 ns/op
BenchmarkObjectsInLocalityLq1000Radius2-2         500000              3418 ns/op
BenchmarkObjectsInLocalityLq10Radius4-2          2000000               808 ns/op
BenchmarkObjectsInLocalityLq50Radius4-2          1000000              1102 ns/op
BenchmarkObjectsInLocalityLq100Radius4-2         1000000              1440 ns/op
BenchmarkObjectsInLocalityLq200Radius4-2         1000000              2169 ns/op
BenchmarkObjectsInLocalityLq500Radius4-2          300000              4000 ns/op
BenchmarkObjectsInLocalityLq1000Radius4-2         200000              7881 ns/op
PASS
ok      github.com/arl/golq        53.587s

Credits

This library is loosely inspired by the C language lq utility in OpenSteer.

License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].