Geometry – Converting a Rotated Ellipse from Parametric to Cartesian Form

conic sectionsgeometry

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?

Best Answer

Your ellipse is centered at the origin. Therefore let's look at the function $$R(t):=y^2(t)+z^2(t)=(a^2+c^2)\cos^2 t+(b^2+d^2)\sin^2 t +2(ab+cd)\cos t\sin t$$ that represents the squared distance of the moving point from the origin. It can be rewritten as $$R(t)={1\over2}\biggl(a^2+c^2+b^2+d^2 +\bigl((a^2+c^2)-(b^2+d^2)\bigr)\cos(2t)+2(ab+cd)\sin(2t)\biggr)\ .$$ We now have to compute the $t$-values for which $R(t)$ becomes maximal, resp. minimal. To this end we compute $$R'(t)=-\bigl((a^2+c^2)-(b^2+d^2)\bigr)\sin(2t)+2(ab+cd)\cos(2t)\ .$$ This vanishes when $$t={1\over2}\arctan{2(ab+cd)\over(a^2+c^2)-(b^2+d^2)}+{k\pi\over2}\qquad(0\leq k\leq3)\ .$$ Plugging in two successive of these four $t$-values into the given parametric representation of the ellipse gives you at once two points on the two main axes. From their coordinates the length of these axes and the angle of rotation can immediately be read off. (For "automatic purposes" some exception handling might be necessary.)