Wikipedia:Reference desk/Archives/Mathematics/2011 August 16

= August 16 =

Extracting parameters from a matrix form ellipse
I found an algorithm for fitting the smallest possible ellipse through a set of points, but the solution is provided as the set of points $$\mathbf{p}$$ for which $$(\mathbf{p}-\mathbf{c})^\mathrm{T}\mathbf{A}(\mathbf{p}-\mathbf{c}) = 1$$ where $$\mathbf{A}$$ is a symmetric, positive definite matrix.

$$\mathbf{c}$$ is already useful as the center of the ellipse, but in order to plot it I need the whole thing in parametric form. This means I need to decompose $$\mathbf{A}$$ into some parameters for the parametric form:


 * $$X(t)=X_c + a\,\cos t\,\cos \varphi - b\,\sin t\,\sin\varphi$$
 * $$Y(t)=Y_c + a\,\cos t\,\sin \varphi + b\,\sin t\,\cos\varphi$$

Is there a simple formula for extracing $$a$$, $$b$$ and $$\varphi$$ from $$\mathbf{A}$$?

Eonzo (talk) 10:08, 16 August 2011 (UTC)


 * If you write $$\mathbf{p}-\mathbf{c} = \begin{bmatrix}x\\y\end{bmatrix}$$ and $$\mathbf{A} = \begin{bmatrix}a&b\\b&c\end{bmatrix}$$, then $$(\mathbf{p}-\mathbf{c})^\mathrm{T}\mathbf{A}(\mathbf{p}-\mathbf{c}) = a x^2 + 2 b x y + c y^2 = 1$$. To finish up, see Rotation of axes. 130.76.64.117 (talk) 00:45, 17 August 2011 (UTC)


 * Thank you for pointing me there, that's exactly what I needed :) Eonzo (talk) 07:51, 17 August 2011 (UTC)