I have a bunch of x,y scatter data and I am trying to fit an ellipse through them. I understand that this question has been asked before and there are resources for this, e.g.:

Fitting ellipse to 5 given points on the plane

Fitting points to tilted, off-center ellipse


However, in my scenario, I need to add in an additional constraint. The ellipse may be rotated, but, it has to rotate about its pivot which is defined by the rightmost/lowest point. I illustrate this problem in the figure below, where the rotation of the 'best-fit' ellipse takes place about its pivot point (circled in red).


In essence, this necessitates that the major semi-axis has to pass through that pivot point.

What would be the best possible way to incorporate this constraint in the ellipse fitting process?

  • 3
    $\begingroup$ Could you provide some test data, add a definition of your desired "best fit" (weight functions), and list any Mathematica code you have tried? Otherwise this seems more like a math problem, not a Mathematica issue. $\endgroup$
    – Jens
    Commented Feb 13, 2015 at 4:35
  • $\begingroup$ LinearModelFit used in the second link allows for a Weights option. Simply give the pivot point a very large weight would do the trick, I guess. $\endgroup$ Commented Feb 19, 2015 at 12:18
  • $\begingroup$ Mmm..., no. That just forces the ellipse to go through that point, not the major axis. $\endgroup$ Commented Feb 19, 2015 at 12:26


Browse other questions tagged or ask your own question.