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.2.1.tar.gz (2.8 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.2.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for densecurves-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2de508d51d18482388d8e380f42352868454fcefae96828c41fc8adb7c2da69e
MD5 8094b417d78d2705d22f16c43c9c682f
BLAKE2b-256 5b698bd63ca5c45f2befc17cf8ca09fe9b2c12e88a711465d28103f8b81aaa18

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for densecurves-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 00720ce9eb46135dd6f8f7f50ff70bed40ff18da0f318866cc7c30d7062162be
MD5 9e46759a537b88973622bf879f506d9a
BLAKE2b-256 e8897b5aa2d3435ce2a5303cd7ff3c7aaf9ef1e4f5871b7db3040297a1d69ef5

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