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.2.tar.gz (2.7 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.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: densecurves-0.1.2.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.5 Linux/6.15.5-arch1-1

File hashes

Hashes for densecurves-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c57003a9fce36e26b82dac996307ea0aa12d141a2fa7f1bd67219e3faf004288
MD5 d22319540adc16edca30587132306fd5
BLAKE2b-256 c28acb00fdc8e2b59d19b6f4d78749527086c535a9c9c534238240b0b868b3d3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for densecurves-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ab0dd489fedd134cc06c2af5557dfe1e6188f335c8c7dec9653087edcfaf0afc
MD5 f8b53fe2f79885a2ba0e82cf03aeccba
BLAKE2b-256 b47f453860d77cad3a4eb744f3b3219871239d796bcd880720a11295ab2696fa

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