Skip to main content

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

Project description

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.

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

densecurves-0.1.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

densecurves-0.1.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file densecurves-0.1.0.tar.gz.

File metadata

  • Download URL: densecurves-0.1.0.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Linux/6.14.2-arch1-1

File hashes

Hashes for densecurves-0.1.0.tar.gz
Algorithm Hash digest
SHA256 313f112fe4e09d81ed5971a5b5408bf70e71429e91c2f9d6fb35a15951bf04af
MD5 0aaa83a4cc62bdab2d16e422f832e78f
BLAKE2b-256 5fe6c08d3a56cfb13c0b74b243b818b87f6c37cc0c2371629d3d3527361d0ef3

See more details on using hashes here.

File details

Details for the file densecurves-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: densecurves-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Linux/6.14.2-arch1-1

File hashes

Hashes for densecurves-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cddb3a70efe978d56f1c7d53631cb7be7ffbf380bc3da24e003c0f179a27878a
MD5 a8dcba1f3c18c746f01b3eb0bb1a8b5c
BLAKE2b-256 0be6df57def3f0236710d7ae7a4c32de02af1a7cefd70e73aab750c373e7c68b

See more details on using hashes here.

Supported by

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