Skip to main content

Efficiently computes the smallest bounding ball of a point set, in arbitrary number of dimensions.

Project description

miniball on PyPI miniball on TravisCI MIT License badge

miniball

A Python module to efficiently compute the smallest bounding ball of a point set, in arbitrary number of dimensions.

The algorithm runs in approximatively linear time in respects to the number of input points. This is NOT a derivative nor a port of Bernd Gaertner’s C++ library.

This project is licensed under the MIT License

Requirements

miniball 1.0 requires

  • Python 2.7, >=3.4

  • Numpy

Installation

$ pip install miniball

Usage

Here is how you can get the smallest bounding ball of a set of points

>>> import numpy
>>> import miniball
>>> S = numpy.random.randn(100, 2)
>>> C, r2 = miniball.get_bounding_ball(S)

The center of the bounding ball is C, its radius is the square root of r2. And that’s it ! miniball does only one thing with one function.

Implementation notes

The algorithm implemented is Welzl’s algorithm. It is a pure Python implementation, it is not a binding of the popular C++ package Bernd Gaertner’s miniball.

The algorithm, although often presented in its recursive form, is here implemented in an iterative fashion. Python have an hard-coded recursion limit, therefore a recursive implementation of Welzl’s algorithm would have an artificially limited number of point it could process.

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

miniball-1.0.3.tar.gz (4.4 kB view details)

Uploaded Source

Built Distributions

miniball-1.0.3-py3.6.egg (5.5 kB view details)

Uploaded Source

miniball-1.0.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

miniball-1.0.3-py2-none-any.whl (4.6 kB view details)

Uploaded Python 2

File details

Details for the file miniball-1.0.3.tar.gz.

File metadata

  • Download URL: miniball-1.0.3.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15+

File hashes

Hashes for miniball-1.0.3.tar.gz
Algorithm Hash digest
SHA256 c99324df330ae3eb10631cc6be605c72d891fccda0902dbe0513329f95563822
MD5 4b4f33421fcf0e8811da117314df8b2f
BLAKE2b-256 9b37312808589603aa52fd9914b890e583d82c9f6611e1d6a32aa30480a0e556

See more details on using hashes here.

File details

Details for the file miniball-1.0.3-py3.6.egg.

File metadata

  • Download URL: miniball-1.0.3-py3.6.egg
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15+

File hashes

Hashes for miniball-1.0.3-py3.6.egg
Algorithm Hash digest
SHA256 8f40014f559341a2d9cef6b35543ead678603f8b4b5f6e50e69cbf907978a6ea
MD5 5ad11ccbaac22d3af43cf419556ea08f
BLAKE2b-256 3cfbc7b260a4053b37f8264550a0e0a0c8150f79611e77d88d55a0f480229501

See more details on using hashes here.

File details

Details for the file miniball-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: miniball-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15+

File hashes

Hashes for miniball-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bcaf02e7a65f250c3a49d0cf5faa591a2d1f342794e7cfe52928ac5bf2357984
MD5 3d10f59adb32d667784d76a8f446dc86
BLAKE2b-256 187cc68b25e0e29952a3f40c4ce3f22ecde4e0ba65acca99da84315787dbfe28

See more details on using hashes here.

File details

Details for the file miniball-1.0.3-py2-none-any.whl.

File metadata

  • Download URL: miniball-1.0.3-py2-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15+

File hashes

Hashes for miniball-1.0.3-py2-none-any.whl
Algorithm Hash digest
SHA256 0c5cfcc71e9ae4688d269859e74406608bb14a4c1adc88ffb0abbfd65514d90a
MD5 6ee39656d2e3c65d747d00e4b45323c7
BLAKE2b-256 2f8b011b13f1afdbba008c7c57a982f7fd4f4a30e64ba513be37a4d0d88fe2e0

See more details on using hashes here.

Supported by

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