<s>[INST] Converting a rotated ellipse in parametric form to cartesian form I have a rotated ellipse in parametric form:
$$\begin{pmatrix}y \\ z\end{pmatrix} = \begin{pmatrix}a\cos t + b\sin t \\ c\cos t + d\sin t\end{pmatrix} \tag{1} $$ or,
$$(y,z) = (a\cos t + b\sin t , c\cos t + d\sin t) \tag{2} $$
By using $$\cos^2 t + \sin^2 t = 1 $$
I can rewrite into:
$$ \frac{(d^2 + c^2)y^2 + (-2bd-2ac)yz + (a^2+b^2)z^2}{(ad-bc)^2} = 1 \tag{3} $$
I need to compare it with the standard form of a rotated ellipse (the input format in a program I am writing):
$$\left(\frac{\cos\theta(y-h) + \sin\theta (z-k)}{r_1}\right)^2 + \left(\frac{\sin\theta(y-h) - \cos\theta (z-k)}{r_2}\right)^2 = 1 \tag{4} $$
To solve for $r_1, r_2, \theta $ (namely the semi-major, minor axis and angle of rotation).
However I realized that this will involve 3 non-linear equations. Although it is solvable, I was wondering if there is a simpler way to find the values?
 [/INST] You can also find the eigenvalues of the matrix 
$\begin{pmatrix}\frac{c^2+d^2}{(ad-bc)^2}&\frac{-ac-bd}{(ad-bc)^2}\\\frac{-ac-bd}{(ad-bc)^2}&\frac{a^2+b^2}{(ad-bc)^2}\end{pmatrix}$
in order to diagonalise it.
The eigenvalues are $\lambda=\frac{s^2\pm\sqrt{(s^2-2\det{})(s^2+2\det{})}}{2(\det{})^2}$, where $\det{} =ad-bc$ and $s^2=a^2+b^2+c^2+d^2$ 
giving your rotated ellipse the form $\lambda_1(y')^2+\lambda_2(z')^2=1$, which gives you the $r_1$ and $r_2$. The eigenvector matrix will give the $\theta$.
</s>