I would like to fit an ellipse to a set of data points in Mathcad and afterwards plot it. Searching the net, I stumbled on to Mike Shaw's post, which answers 75% of my question: See Plotting an Ellipse after an Ellipse Fit

Could someone enlighten me how to determine the co-effiecients and centre of the ellipse, in Mathcad, using the fitting algorithm; this for formula: $ax^2 +bxy+cy^2 +dx+ey+f=0$

Thanks in advance,


  • $\begingroup$ If you want an ellipse (as opposed to some other type of conic section curve), then you have to constrain the coefficients to ensure this. $\endgroup$
    – bubba
    Nov 20, 2015 at 13:21

1 Answer 1


You can find the mathematics in this document, along with several other fitting techniques. The same web site has code to do the fitting. I have never used the fitting code, but I have used other code from this site, and found it be of very high quality.

Mike Shaw's post says he used the algorithm decribed in this paper, which also looks very good, to me.

  • $\begingroup$ Thanks for the answer... I was under the assumption that Mike used some sort of fitting functionality within MathCAD like "genfit" with just $ax^2+bxy+cy^2+dx+ey+f=0$ and the data points as input. Enlightened by your answer I successfully implemented the algorithm of the paper. $\endgroup$
    – Simon
    Nov 25, 2015 at 7:51
  • $\begingroup$ Simon - Hi there. I implemented the algorithm from the paper in the Link using the Programming Tools within Mathcad. If I'm honest I didn't even think about Genfit, etc as I was wanting to write some C libraries to do it :-) $\endgroup$
    – Mike
    Feb 16, 2016 at 14:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .