Skip to main content

A cythonized version of that one hilbert function you keep copy-pasting.

Project description

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. Inputs must be in the range 0 to 2^16-1, inclusive.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cyhilbert-1.3.1.tar.gz (29.7 kB view hashes)

Uploaded Source

Built Distribution

cyhilbert-1.3.1-cp310-cp310-macosx_12_0_arm64.whl (12.4 kB view hashes)

Uploaded CPython 3.10 macOS 12.0+ ARM64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page