PrimaryAxes PrimaryAxesVectors |
Cellzilla2D Home |

Description

Finds the primary axes of an ellipse that best fits a set of points.

Needs["Cellzilla2D`"];

Return Value

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

"Angles"→angles (in
radians) between each of the two primary axes and x-axis

"Eigenvalues"→{λ1, λ2} eigenvalues of intertia matrix

"Vectors"→{v1, v2} eigenvectors of intertia matrix

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

PrimaryAxesVectors[{{x1,y1},...}] returns a list containing only the vectors; it is equivalent to "Vectors"/.PrimaryAxes[{{x1,y1},...}]

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