Mon Apr 23 20:10:02 PDT 2012 Kevin Karplus
The three files
svd_FitHypersphere.py
numpy_FitHypersphere.py
scipy_FitHypersphere.py
all provide the same function: fit_hypersphere(data,method)
The svd version is the slowest, but is the only one that is capable of
handling the singular values that arise when the noise level is very
low (when the data falls precisely on a hypersphere).
It uses only routines from the numpy package.
On my laptop it take 18.1 seconds to solve 200 circles for 1000 points
using both Pratt and Hyper methods.
It implements Hyper, Taubin, and Pratt methods
The numpy version is a faster version, taking only 3.9 seconds to
solve 200 circles for 1000 points using both Pratt and Hyper
methods. It crashes when the error is very low, as it tries to
get the eigenvalues of singular matrix.
It implements Hyper and Pratt methods
The scipy version takes 3.9 seconds to solve 200 circles for 1000
points using both Pratt and Hyper methods. It crashes when the
error is very low, as it tries to get the eigenvalues of singular
matrix. It requires installing scipy, which is much more trouble
than installing numpy, as scipy requires a working fortarn
compiler.
It implements Hyper, Taubin, Pratt and Kasa methods.
Bottom-line: the numpy version is fast and easy to install, the svd
version is most robust, and the scipy version is fast and has the most
variants.
If you need speed, use the numpy version with Hyper.
If you need robustness, use the svd version with Hyper.
If you need the Kasa algorithm, use the scipy version.
Creative Commons Attribution-ShareAlike 3.0 Unported License.
http://creativecommons.org/licenses/by-sa/3.0/