semvec/pypi-packages huggingface dataset:
boxdist 1.3.1
Cythonized geodetic and planar distance functions for R-Trees.
License: MIT
Requires Python: >=3

# boxdist

Cythonized geodetic and planar distance functions for R-Trees. The implementation is adapted from [Tile38](https://github.com/tidwall/tile38/blob/f24c251ee61e9c7a3cea50df82f1ebdc7be2bb64/internal/collection/geodesic.go), which is based on the paper [Geodetic Distance Queries on R-Trees for Indexing Geographic Data](https://dl.acm.org/doi/10.5555/2960717.2960729).

## Geodetic

```python
from boxdist import geodetic_box_dist

targetlon = -72.946472
targetlat = 45.154927

minlon = -74.19342
minlat = 45.265222
maxlon = -73.157959
maxlat = 45.704261

meters = geodetic_box_dist(
    targetlon,
    targetlat,
    minlon,
    minlat,
    maxlon,
    maxlat,
)

meters #=> 20612.892322138163
```

## Planar

```python
from boxdist import planar_box_dist

targetx = 0
targety = 0

minx = 1
miny = 1
maxx = 2
maxy = 2

squared_dist = planar_box_dist(
    targetx,
    targety,
    minx,
    miny,
    maxx,
    maxy,
)

squared_dist #=> 2
```
cyhilbert 1.3.1
A cythonized version of that one hilbert function you keep copy-pasting.
License: MIT
Requires Python: >=3

# cyhilbert

A cythonized version of that one hilbert function you keep copy-pasting. See the original implementation of [Hilbert curves in O(log(n)) time](http://threadlocalmutex.com/?p=126). Inputs must be in the range 0 to 2^16-1, inclusive.

```python
from cyhilbert import hilbert, DIMS, BITS_PER_DIM, MAX

DIMS #=> 2
BITS_PER_DIM #=> 16
MAX #=> 65535

hilbert(0, 0) #=> 0
hilbert(1, 0) #=> 1
hilbert(1, 1) #=> 2
hilbert(0, 1) #=> 3
hilbert(0, 2) #=> 4
hilbert(0, 3) #=> 5
hilbert(1, 3) #=> 6
hilbert(1, 2) #=> 7
```