Skip to main content

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

Project description

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)

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.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

miniball-1.0.2-py2-none-any.whl (4.5 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: miniball-1.0.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.7.15rc1

File hashes

Hashes for miniball-1.0.2.tar.gz
Algorithm Hash digest
SHA256 67bc42c7960877c4149e9b795153cf772a0662bfc68e781a807dc61f8461c327
MD5 9f414d1f9ec55ba044250f6aef1555ef
BLAKE2b-256 6ca12cbaf364701093c3fff371d32f27bcc8aac95a90c0d3228b7ca3088d1662

See more details on using hashes here.

File details

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

File metadata

  • Download URL: miniball-1.0.2-py2-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.7.15rc1

File hashes

Hashes for miniball-1.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 b6407f00f7ade7aa45288a029affff2f17ceb92083451ae106aeafd5bf3c960e
MD5 d3148a190a0fd02f26838827edc52ecd
BLAKE2b-256 0776bb579cfccf6764af71afe87aaae8af846517523a80c5d543c882fa4d2900

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