Skip to main content

Dense Curves

Simple and efficient implementations of space-filling / Peano / FASS curves.

Installation

The package is available on pypi:

pip install -U densecurves

Hilbert Curve

Nomenclature

The Hilbert curve is a finite approximation of a space filling curve.

The curve of order $p$ and rank $n$ is characteristized by:

  • $n$ distinct axes, the number of coordinates of its points
  • $2 ^ {p}$, the dimension along each axis
  • $2 ^ {p n}$ vertexes, the "corners" of its graph

The order of the curve $p$ is often referred to as the "iteration".

The intermediate points between the vertexes are ignored. Here, the vertexes are represented by integer coordinates.

Load

import densecurves.hilbert

Compute

Convert a position / distance along the 1D curve to a ND point:

densecurves.hilbert.point(position=42, order=4, rank=2)
# [7, 7]

And the reverse operation:

densecurves.hilbert.position(coords=[1, 2, 3], order=4, rank=3)
# 36

Credits

"Programming the Hilbert curve" by John Skilling.

License

Licensed under the aGPLv3.

Metadata

Release files for densecurves 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for densecurves 0.2.1
File Size Uploaded Provenance Actions
densecurves-0.2.1.tar.gz 2.8 kB Without provenance Details for densecurves-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for densecurves 0.2.1
File Interpreter ABI Platform Actions
densecurves-0.2.1-py3-none-any.whl Python 3 none any Details for densecurves-0.2.1-py3-none-any.whl

Total release size: 7.8 kB

Release files / densecurves-0.2.1.tar.gz

Download URL densecurves-0.2.1.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2de508d51d18482388d8e380f42352868454fcefae96828c41fc8adb7c2da69e
BLAKE2b-256 checksum
How to use checksums
5b698bd63ca5c45f2befc17cf8ca09fe9b2c12e88a711465d28103f8b81aaa18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.13.5 Linux/6.15.7-arch1-1

Release files / densecurves-0.2.1-py3-none-any.whl

Download URL densecurves-0.2.1-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00720ce9eb46135dd6f8f7f50ff70bed40ff18da0f318866cc7c30d7062162be
BLAKE2b-256 checksum
How to use checksums
e8897b5aa2d3435ce2a5303cd7ff3c7aaf9ef1e4f5871b7db3040297a1d69ef5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.13.5 Linux/6.15.7-arch1-1

Security for densecurves 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page