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.1.tar.gz (2.6 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.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: densecurves-0.1.1.tar.gz
  • Upload date:
  • Size: 2.6 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.1.tar.gz
Algorithm Hash digest
SHA256 e6fc9d9fb832567150f1ff7d4e590ecbb07f9103cf5ea775b79c51766e9e51ae
MD5 600795c11d04fecb56936650b8e5bd54
BLAKE2b-256 4d69e183bdf6b0967ab6b6eff8a8914ddecaf72b2cf0ce1fe1329be5496b7dc0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: densecurves-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e9c23d48e5735c300f9137e44c6d3bdcaa149dd4d216aa9a52ada9124659a57
MD5 5912fe519c5689f752034ab47ca22caa
BLAKE2b-256 280257592f497cc06825d98329739088326aba4ec7ae71ec913321682730d6b5

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