# How to convert the general form of ellipse equation to the standard form?

How to convert the general form of ellipse equation to the standard form? $$-x+2y+x^2+xy+y^2=0$$

-
You really need to provide some context for this question if you are hoping that users here will be able to help you: What progress have you made so far? What exactly is causing you problems? Is the question homework? –  Old John Dec 6 '13 at 21:11
en.wikipedia.org/wiki/Matrix_representation_of_conic_sections is a reference I have found to be very useful for this sort of question. –  DanielV Jan 1 at 8:16


$$f(x, y) = A_0x^2 + 2B_0xy + C_0y^2 + 2D_0x + 2E_0y + F_0 = 0$$

Then the center will occur where $\indp{f}{x} = 0$ and $\indp{f}{y} = 0$, and solving the linear equations (2x2 matrix) you get the center $c$ at:

$$c_x = \frac{C_0D_0 - B_0E_0}{B_0^2 - A_0C_0}$$ $$c_y = \frac{A_0E_0 - B_0D_0}{B_0^2 - A_0C_0}$$

So the conic section shifted to be at the center will occur at

$$g(x, y) = f(x + x_c, y + y_c) = Ax^2 + 2Bxy + Cy^2 + F = 0$$

for some new coefficients $A,~ B,~ C,~ \text{and } F$:

\begin{align} A &= A_0(A_0C_0 - B_0^2) \\ B &= B_0(A_0C_0 - B_0^2) \\ C &= C_0(A_0C_0 - B_0^2) \\ F &= F_0(A_0C_0-B_0^2) -A_0E_0^2 - C_0D_0^2 +2B_0D_0E_0 \\ \end{align}

Now you must rotate the values of $x, y$ to align the axises, so you need to introduce two new variables $u, v$ under the constraint:

$$u = cx - sy$$ $$v = sy + cx$$ $$s^2 + c^2 = 1$$

Where $s$ and $c$ represent the sine and cosine of the rotation (although we will avoid trig functions like the plague).

Solving the transform for $x$ and $y$ and plugging into the definition for $g$ we get

$$h(u, v) = (Ac^2 -2Bcs+ Cs^2)u^2 + 2(Acs + Bc^2 -Bs^2 -Ccs )uv + (As^2 -2Bcs+ Cc^2)v^2 + F = 0$$

To obtain axial alignment, we need to choose $c$ and $s$ in a way that the coefficient of $uv$ is $0$ while maintaining $s^2 + c^2 = 1$.

$$Acs + Bc^2 -Bs^2 -Ccs = 0$$ $$c^2 + s^2 = 1$$

which solves to $$c^2 = \frac{\pm(C - A)\sqrt{M} + M}{2M}$$ $$s^2 = \frac{\mp(C - A)\sqrt{M} + M}{2M}$$ $$M = A^2 + C^2 + 4B^2 - 2AC$$

which is enough information to back substitute and get either an analytical expression or computational computation for a centered axial aligned conic section.

For your example: $$f(x, y) = -x+2y+x^2+xy+y^2=0$$

So $A_0 = 1$, $B_0 = 1/2$, $C _0= 1$, $D_0 = -1/2$, $E_0 = 1$, $F_0 = 0$.

So the center occurs at

$$c = \begin{bmatrix} \frac 43 \\ -\frac 53 \end{bmatrix}$$

and the origin centered shifted conic section is:

$$g(x, y) = \frac 34 x^2 + \frac 34 y^2 + \frac 34 xy - \frac 74 = 0$$

with the new $A = \frac 34$, $B = \frac 38$, $C = \frac 34$, $F = -\frac 74$.

So with yours, $M = \frac {9}{16}$, and $c = s = \pm \frac{1}{\sqrt{2}}$ (your conic section was rotated by $\frac 18$ of a revolution).

So the centered axially aligned transform of your example is:

$$9v^2 + 3u^2 - 14=0$$

-

The idea is to rotate your axes , so that the $xy$ term disappears. Define a transformation ( a rotation ) $x'=rcos\theta, y'=rsin\theta$ , sub-in in your equation, and set the mixed $x'y'$-terms equal to $0$. This will give you the necessary angle of rotation to make the $xy$ terms disappear.

See this post: How to put $2x^2 + 4xy + 6y^2 + 6x + 2y = 6$ in canonical form for another example.

-
Thank you for your guidance! if I want plot it, how can do this even without standard form? –  user113962 Dec 6 '13 at 20:56
Only way I can think of is: take standard form, draw it and then rotate back to the original form by the same angle $\theta$. But let me see if I can think of something else. –  user99680 Dec 6 '13 at 21:11
I would be grateful if you help help me in this case. –  user113962 Dec 7 '13 at 7:27
Sure; have you found the rotated form yet ? –  user99680 Dec 7 '13 at 7:45
yes, but it is difficult way to show it if I want change parameters and then I obtain the standard form for each changing! –  user113962 Dec 7 '13 at 7:55