FitEllipse:

Path: Math/Geometry

% Fit an ellipse.

   The coefficients are:

   a(1)*x^2 + a(2)*x*y + a(3)*y^2 + a(4)*x + a(5)* y + a(6) = 0;

   Type FitEllipse for a demo.

   Since version 2014.1
--------------------------------------------------------------------------
   Form:
   [a, err] = FitEllipse( x, y )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   x              (:,1)  x values
   y              (:,1)  y values
   solnMethod     (1,1)  Solution method. 1=constrained, 2=unconstrained
                         Default is 1, constrained. Calls "eig".

   -------
   Outputs
   -------
   a              (6,1)  Coefficients
   err            (1,1)  Fit error

--------------------------------------------------------------------------
   Reference: Fitzgibbon, A. Pilu, M. and Fisher, R. B., "Direct Least
              Squares Fitting of Ellipses,"Pattern Analysis and Machine
              Intelligence, Vol. 21, No. 5, May 1999.
--------------------------------------------------------------------------

Children:

Common: CommonData/SwooshWatermark
Common: General/CellToMat
Common: General/MatToCell
Common: General/Watermark
Common: Graphics/NewFig
Common: Graphics/Plot2D
Common: Graphics/PltStyle
Math: Linear/Mag

Back to the Math Module page