Software for finding a best-fit ellipse ()?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
jesusu2
Messages
5
Reaction score
0
Hello all, I'm calibrating a magnetometer sensor. An uncalibrated sensor will output values that will graph an ellipse. A calibrated sensor will output values that will graph a circle. Since there's data points all over the place, I'd like to find a piece of software that will take my data and give me a best-fit ellipse, with its equation, and with this I'll be able to calculate the eccentricity and see whether my calibrations actually worked.
I'm not versed in coding whatsoever, so I would prefer if there was some sort of .exe program I could use that would automatically calculate based off my values.
I've attached an picture of the type of data I'm dealing with.
 

Attachments

  • plot.png
    plot.png
    8.7 KB · Views: 838
Physics news on Phys.org
This would normally be done with a math package and hand-writing the code.
http://www.emis.de/journals/BBMS/Bulletin/sup962/gander.pdf

There are dedicated libraries for this it seems - for the googling. i.e.
http://www.codeproject.com/Articles/692787/Best-fitting-line-circle-and-ellipse
... but you are not so much of a programmer... hmmm...

For ready-to-use I'd suggest the Matlab function "fit_ellipse"
http://www.mathworks.com/matlabcentral/fileexchange/3215-fit-ellipse
... you can also get MATLAB to calculate the eccentricity and just output that.

I would not expect to find a purpose built windows executable for your purpose - I think I saw a geology program "ellipsefit" a while ago tho - it is the kind of functionality that gets built into math programs and you are encouraged to learn to use at least one of Matlab, Mathematica, GNU Octave. I know that seems like overkjill for just this one task but it pays off in the long run.