Conic Sections – Calculating Semi-Major Axis Length from Ellipse Equation

conic sections

What is the most accurate way of solving the length of the semi-major axis of this ellipse?

$-0.21957597384315714 x^2 -0.029724573612439117 xy -0.35183249227660496 y^2 -0.9514941664721085 x + 0.1327709804087165 y+1 = 0$

The answer should be extremely close to the correct value of the length of the semi-major axis which is equal to $3.073400961177073$

I already tried to rotate the graph so that the major axis will coincide with the x-axis making the xy term equal to zero, then I made it into standard form, in which I was able to calculate the length of semi-major axis. However, the result differs from the true value by about $0.1$ . This difference is not acceptable since this value will be used many times for the orbit propagation formulas and in our final computation, the result has about 5% error. We could not accept this 5% error since our goal is to have an error of at least 2%. Thank you in advance.

Best Answer

In this answer to a related question, it is shown that $$ Ax^2+Bxy+Cy^2+Dx+Ey+F=0 $$ is simply a rotated and translated version of $$ \small\left(A{+}C-\sqrt{(A{-}C)^2+B^2}\right)x^2+\left(A{+}C+\sqrt{(A{-}C)^2+B^2}\right)y^2+2\left(F-\frac{AE^2{-}BDE{+}CD^2}{4AC{-}B^2}\right)=0 $$ which says the semi-major axis is $$ \left[\frac{2\left(\frac{AE^2{-}BDE{+}CD^2}{4AC{-}B^2}-F\right)}{\left(A{+}C-\sqrt{(A{-}C)^2+B^2}\right)}\right]^{1/2} $$ and the semi-minor axis is $$ \left[\frac{2\left(\frac{AE^2{-}BDE{+}CD^2}{4AC{-}B^2}-F\right)}{\left(A{+}C+\sqrt{(A{-}C)^2+B^2}\right)}\right]^{1/2} $$