0

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

Tom
  • 511

2 Answers2

1

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

John Alexiou
  • 13,816
  • ahh I get it, thanks. – Tom Oct 26 '15 at 15:34
  • just for certainty, I would implement this is Mathematica's notation (see link below, second equation top of page in yellow) as (1/2)ArcTan[a-c,2b], yes? – Tom Oct 26 '15 at 15:44
  • https://reference.wolfram.com/language/ref/ArcTan.html – Tom Oct 26 '15 at 15:44
  • 1
    Yes, $\Delta x = a-c$ and $\Delta y = 2 b$. That's why I added the sin and cos expansions. Mathematica has ArcTan[Δx,Δy] and most other places have atan2(Δy, Δx). It is confusing. – John Alexiou Oct 26 '15 at 15:46
0

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.

bubba
  • 43,483
  • 3
  • 61
  • 122
  • I don't think this is true. In the question above I plotted an ellipse with $a=c=5/32$ and it does not seem to be an ellipse – Tom Oct 26 '15 at 15:32
  • I think it is true. Your example doesn't have $b=0$ – bubba Nov 01 '15 at 06:07
  • Yes I think it is true now, I think you edited it. Before there wasn't the b=0 qualifier. No matter :) – Tom Nov 05 '15 at 13:47