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.
Thanks!
Ron 6 6625 on********@hotm ail.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 notverythoughtful answer: a sledgehammer method is to throw an
implementation of a standard nonlinear leastsquares algorithm at the
problem. For example, SciPy contains a wrapper of MINPACK's nonlinear
LS solver . There are several implementations of the same
(LevenburgMarquardt) algorithm in pure Python floating around, too.
If there's no scatter, it's time to dig out your old algebra textbooks
:)
John
John J. Lee wrote: on********@obvi ous.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 notverythoughtful answer: a sledgehammer method is to throw an implementation of a standard nonlinear leastsquares algorithm at the problem. For example, SciPy contains a wrapper of MINPACK's nonlinear LS solver . There are several implementations of the same (LevenburgMarquardt) algorithm in pure Python floating around, too.
A quick comment in case it's not obvious: an ellipse is not a function in
Cartesian coordinates, and most standard LS solvers expect a function. So
it's probably best to convert things over to polar before feeding the data to
the LS solver.
f
Ron Kneusel wrote: 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.
It's not so easy; it's a nonlinear orthogonal distance regression problem.
I know of a FORTRAN package and I myself have a (more general) package written
in Scilab ( a Matlab "clone" )
If you have just a few datasets, I'll compute a fit for you.
But implementing it in Python would be much work.

Helmut Jarausch
Lehrstuhl fuer Numerische Mathematik
RWTH  Aachen University
D 52056 Aachen, Germany
Aloha,
Ron Kneusel wrote: 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.
See http://www.magicsoftware.com/Approximation.html
Here are C++ Sources, you will need a interface like SWIG for using this
in python.
Wishing a happy day
LOBI
On Wed, 14 Jul 2004, Fernando Perez wrote: A quick comment in case it's not obvious: an ellipse is not a function in Cartesian coordinates, and most standard LS solvers expect a function. So it's probably best to convert things over to polar before feeding the data to the LS solver.
You could break both the ellipse and the data into two pieces (say, y>=K
and y<K). Polar coordinates might get you more uniform results, though.
Helmut Jarausch wrote: Ron Kneusel wrote:
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.
It's not so easy; it's a nonlinear orthogonal distance regression problem. I know of a FORTRAN package and I myself have a (more general) package written in Scilab ( a Matlab "clone" )
I wrote a wrapper to the FORTRAN ODRPACK. http://starship.python.net/crew/kern...odr0.6.tar.gz
If you have just a few datasets, I'll compute a fit for you. But implementing it in Python would be much work. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics 
by: Grant Edwards 
last post by:
I'm looking for a surface fitting library for Python.
Something like the leastsquares module in scientific python,
except I want to fit a surface (z = f(x,y)) instead of a curve
(y = f(x)).
I found a couple other curve fitting libraries (some are
wrappers to C/Fortran libs I don't have), and I found a
curve and surfacefitting web page...

by: lgeastwood 
last post by:
I have tweaked the PictureBox97.mdb (Stephen Lebans <www.lebans.com>)
code to nicely draw lines, rectangles and circles to the specs that I
input.
I'm at a loss though with trying to setup an Ellipse Drawing Function.
The following code I found on Google works in VB5 and draws an ellipse
shape no problem using the Circle Method.
Private...

by: Christopher Ireland 
last post by:
Hello!
Using the definition for en ellipse (http://en.wikipedia.org/wiki/Ellipse) I
can draw an arc of points. However, the end points of this arc do not
coincide with the end points of an arc drawn with the DrawArc method, e.g.
public partial class Form2 : Form
{
public Form2()
{

by: weird0 
last post by:
I wanted to draw an ellipse using c# with System.Drawing.Graphics. I
tried out several tutorials and none of them worked and there seems to
be something missing. One did execute without any errors but it did
not render an ellipse on the form.
I want to create an ellipse with just a new project with one form
default, that is Form1. I want...

by: illusion.admins 
last post by:
I am trying to code something to tell me if a selected point is in a
particular ellipse. For the ellipse I know how it was constructed
(know the x,y, and width, height). But if I just check to see if the
point is in the rectangle making up the ellipse wouldn't that possibly
give me a false answer? Eg if the point is the upper left coordinate...
 
by: PankajGaur 
last post by:
Hi,
I need to create a Ellipse shaped user control which have folloiwng
attributes:
1) The edges are smooth
2) The control shuld only be selected when click on the ellipse shape & not
when click on the empty area of Client Rectangle
What I have done so far:
I override the OnPaintMethod as below:

by: =?Utf8?B?RGFu?= 
last post by:
I would like to draw an ellipse on a windows form and through mouse drags
stretch, rotate and relocate the ellipse.
Thanks in advance  Dan

by: =?Utf8?B?UGFua2FqR2F1cg==?= 
last post by:
Hi,
I need to create a Ellipse shaped user control which have folloiwng
attributes:
1) The edges are smooth
2) The control shuld only be selected when click on the ellipse shape & not
when click on the empty area of Client Rectangle
What I have done so far:
I override the OnPaintMethod as below:

by: Evelien 
last post by:
Dear pythonusers,
I am trying to do a nonlinear least squares fitting. Maybe trying is
not the best word, as I already succeeded in that. At the moment I am
using leastSquaresFit from Scientific Python. I know of other least
squares routines, such as the one in scipy.optimize and I believe
there is also one in numpy. Now here is my...

by: marktang 
last post by:
ONU (Optical Network Unit) is one of the key components for providing highspeed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...

by: Hystou 
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
 
by: Oralloy 
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bitfields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...

by: jinu1996 
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...

by: tracyyun 
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, ZWave, WiFi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...

by: conductexam 
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...

by: 6302768590 
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

by: muto222 
last post by:
How can i add a mobile payment intergratation into php mysql website.
 
by: bsmnconsultancy 
last post by:
In today's digital era, a welldesigned website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
 