Angle between x-axis and major axis of ellipse

3.4k Views Asked by At

The MathWorld resource here gives a formula for the counter-clockwise angle $\phi$ between the x-axis and the major-axis of an ellipse $a x^2 +2bxy + cy^2 + 2dx + 2fy + g = 0$ as

But what do I do when $a=c$? For example the ellipse below is rotated by $\pi/4$ but $a$ and $c$ are equal so are undefined in the above equation. Does this formula need a slight tweak (with a "$\leq$" symbol)?

enter image description here

2

There are 2 best solutions below

4
On BEST ANSWER

Consider the answer as

$$ \phi = \frac{1}{2} {\rm atan}\left(\frac{2 b}{a-c}\right) = \mbox{ 0.5*atan2(2b, a-c) } $$

You will also find that

$$\begin{align} \cos (2 \phi) &= \frac{a-c}{\sqrt{(a-c)^2+4 b^2}} \\ \sin (2 \phi) &= \frac{2 b}{\sqrt{(a-c)^2+4 b^2}} \end{align}$$

3
On

If $a=c$, and $b=0$, then the ellipse is actually a circle, so it doesn't have a major axis. This being the case, it's not too surprising that the formulae don't work. The MathWorld page should have mentioned this; it's not entirely obvious.

For details, see this page.