6
$\begingroup$

If $c = 0$, the parametric form is obviously $x = \sqrt{\frac{d}{a}} \cos(t), y = \sqrt{\frac{d}{b}} \sin(t)$.

When $c \neq 0$ the sine and cosine should be phase shifted from each other. How do I find the angular shift and from there how do I adjust the factors multiplying the sine and cosine?

  • 1
    Formulae 16-23 [here](http://mathworld.wolfram.com/Ellipse.html) are useful.2011-10-05

3 Answers 3

8

You would complete squares: $\left(a x + \frac{1}{2} c y\right)^2 + \left(a b - \frac{c^2}{4} \right) y^2 = a d$.

From there: $a x + \frac{c}{2} y = \sqrt{a d} \sin(t)$ and $\sqrt{a b - \frac{c^2}{4}} y = \sqrt{a d} \cos(t)$, assuming $c^2 < 4 a b$, and $a d > 0$.

Solving for $x$ and $y$ and denoting $\mathcal{D} = 4 a b - c^2$ $ x(t) = \sqrt{\frac{d}{a}} \left( \sin(t) - \frac{c}{\sqrt{\mathcal{D}} } \cos(t) \right) \qquad y(t) = \frac{2 \sqrt{a d}}{\sqrt{\mathcal{D}}} \cos(t) $

  • 1
    In the Olden Days (when I was in school) there was a college course called "Analytic Geometry". It would include such things as finding the rotation to eliminate the $xy$ term in a plane conic section.2011-10-05
3

If the parametric ellipse coordinates are $\left(x(t),y(t)\right) = (X \cos\varphi \cos(t)-Y \sin\varphi \sin(t), Y \cos\varphi \sin(t)+X \sin\varphi \cos(t)) $

Then the parameters $ X,Y,\varphi $ are $ X =\pm \sqrt{\frac{2 d}{a+b+\sqrt{(a-b)^2+c^2}}} $

$ Y =\pm \sqrt{\frac{2 d}{a+b-\sqrt{(a-b)^2+c^2}}} $

$ \varphi = \frac{1}{2}\tan^{-1}\left(\frac{c}{a-b}\right) $

Example:

$10 x^2+20 y^2-18 x y = 100$

The coefficients are ($a=10$, $b=20$, $c=-18$, $d=100$)

Wolfram Alpha Implicit Curve

The parametric coefficients are $(-1.008311 \cos(t)+3.973667 \sin(t), 1.713639 \cos(t)+2.338119 \sin(t))$ Wolfram Alpha Parametric Curve

1

(This is supposed to be a comment on ja72's answer, but it got too long.)

ja72's answer mentions the formula

$\tan\,2\varphi = \frac{c}{a-b}$

I consider it a bit wasteful of effort to evaluate an arctangent and the subsequently pass it as the argument of a trigonometric unction much later; to avoid this, we can use the double angle formula for the tangent and the "Citardauq" formula in tandem to yield the relation

$\tan\,\varphi=\frac{c}{a-b+(\mathrm{sign}\,c)\sqrt{c^2+(a-b)^2}}$

Denoting this expression as $t$, we can then substitute this into the rotation matrix

$\frac1{\sqrt{1+t^2}}\begin{pmatrix}1&-t\\t&1\end{pmatrix}$

ja72's answer already gave the formulae for the axes; remember that $(p\sin\,u,q\cos\,u)$ and $(p\cos\,u,q\sin\,u)$ are the same ellipse traversed differently, so you can subsequently rotate whichever of the two expressions you pick with the rotation matrix I gave earlier.