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.0.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.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: densecurves-0.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 bfbe9a88ab8a7acfcdea206a1103fbbbf91359bf08db34895d404d81119b99e0
MD5 af9804e3bfa0e0c2ce4a01e26cfb7e03
BLAKE2b-256 32387a66e86d98bf6c02da5480dd34bd04fa8fefeee0120661a677f07a2da27e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: densecurves-0.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bee1f476fadc783e8745ca6017dda0f92021c0b099a704fd822d450fa8b7a341
MD5 5013aaa797f78a18dad926170872fecc
BLAKE2b-256 e1e72770f7739a4922bb41b5077276a94ccc5dbe6b29a166f71a662ea6015126

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