2

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.

Anon
  • 73

2 Answers2

5

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} $$

robjohn
  • 345,667
  • I'll try this formula. Thank you so much. – Anon Apr 09 '15 at 19:11
  • Note that I have added the square roots that I forgot before. – robjohn Apr 09 '15 at 19:18
  • Just as I decided to write this exact answer you beat me to it. – John Alexiou Apr 09 '15 at 19:23
  • Note: Use http://math.stackexchange.com/a/785054/3301 to find the center. – John Alexiou Apr 09 '15 at 19:25
  • The answer is very accurate! Thank you very much! – Anon Apr 09 '15 at 19:30
  • I have an additional question. Hmm, I can calculate the foci of the ellipse using equation 2 but how can I turn it into its original coordinates? Thanks – Anon Apr 09 '15 at 20:05
  • The equations in this and the linked answer are geared toward removing the original coordinates in order to determine the shape and size of the congruent ellipse with "standard orientation and location". The location of these features in the original coordinates would require a separate calculation, more than a comment could hold. – robjohn Apr 09 '15 at 20:28
2

One strategy is to rotate the coordinate system so the semi-major/minor axes are parallel to the coordinate axis.

To do that, write your equation as $ax^2 + 2bxy + cy^2 + dx + ey = 1$. We can rewrite the first three terms as $(x \ y)A(x \ y)^T$ for the symmetric matrix $A = \left( \begin{matrix} a & b \\ b & c \end{matrix} \right)$. That matrix can be diagonalized and in the new coordinates, call them $(x', y')$, we have

$$fx'^2 + gy'^2 + hx' + jy' = 1$$

That equation you can now write in a 'standard form' for an ellipse and hence calculate precisely the length of either the semi-major or -minor axis.


I find that $A = RDR^{-1}$ where $D = diag(0.353482063035, 0.21792640308) = diag(f,g)$. (Using WA, link, with the rotation matrix $R$.)

Simon S
  • 26,524
  • Is there any formula to calculate for the semi-major axis directly using the coefficients A, B, C, D, E and F? – Anon Apr 09 '15 at 18:29
  • We could derive one if one is going to be doing this calculation often. I don't know it and would have to derive it from scratch. I doubt it's pretty. This approach does generalize to such a result. – Simon S Apr 09 '15 at 18:33
  • You should be able to write down quickly the length as a function of $f,g,h,j$. – Simon S Apr 09 '15 at 18:34
  • I do not really have enough knowledge about matrices but I'll try to understand your answer. What's the A in the middle of $(x,y)$ and $(x,y)^T$ – Anon Apr 09 '15 at 18:36
  • $A$ is the symmetric matrix given above. For completeness, the new coordinates are given by $$(x' \ y')^T = R(x \ y)^T$$ If you don't know linear algebra, how were you meant to solve this problem? – Simon S Apr 09 '15 at 18:37
  • Maybe I'll learn the basics now. Hmm, can you show how it is diagonalized? Thanks. – Anon Apr 09 '15 at 18:41
  • Sorry no, that's a whole lecture or two or three in linear algebra. If you need to, go research that for example on Khan Academy. – Simon S Apr 09 '15 at 18:42
  • Thank you so much! I'll just research more about what you're saying here. – Anon Apr 09 '15 at 18:44