Ellipse fitting in python?

John J. Lee jjl at pobox.com
Thu Jul 15 00:32:44 CEST 2004

oneelkruns at hotmail.com (Ron Kneusel) writes:

> Is there a python package out there that supports fitting a set of 2D
> points to an ellipse?  I haven't been able to find one.

This is a set of points with some noise (scatter), right?

A not-very-thoughtful answer: a sledgehammer method is to throw an
implementation of a standard nonlinear least-squares algorithm at the
problem.  For example, SciPy contains a wrapper of MINPACK's nonlinear
LS solver .  There are several implementations of the same
(Levenburg-Marquardt) algorithm in pure Python floating around, too.

If there's no scatter, it's time to dig out your old algebra textbooks


More information about the Python-list mailing list