FitEllipse | Cellzilla2D Home |

Description

Fits an ellipse to a set of points.

Needs["Cellzilla2D`"];

Return Value

FitEllipse[{{x1,y}, {x2, y2},
...}] returns information about a "best fit" ellipse
as an option list:

"Angle"→angle (in
radians) between semimajor-axis and x-axis

"Axes"→{vx,vy} vector
in direction of semi-major axis and length equal to
semi-major axis;

"Graphics"→graphics
object with simple plot of object and directions of major
and minor axes.

Options

Example

[ Download Example as Zipped Mathematica Notebook ]

Implementation Notes

The primary axes are found by first translating the ellipse into center-of-mass coordinates V={{x1', y1'), {x2',y2'},...} where each {xi', yi'}={xi,yi}-{xc,yc}, and {xc,yc} is the center of mass. Then the eigenvalues and eigenvectors of the matrix

^{T}V

See Also