How to find all the parameters of an ellipse from its general equation of conic?

55 Views Asked by At

I have an ellipse in the form $ax^2+bxy+cy^2+dx+ey+f=0$ and from this how would I find the length of the semi major and minor axis, the tilt, and the center of it? I made an ellipse fitting code to give me the values of (a,b,c,d,e,f) But I need to print out these parameters to make it a bit more efficient.

1

There are 1 best solutions below

0
On

The $xy$ term exists if the semi major and minor axes are not parallel to the coordinate axes. A coordinate relationship makes them parallel, so set $x=x'\cos \theta + y' \sin \theta$ and $y=y'\cos \theta+x'\sin \theta$. Plug that into the original equation to get new coefficients. You'll have a term in the form $x'y'$ and should be able to find a $\theta$ that makes that term vanish. The value of $\theta$ is the tilt.

After that you should have an equation of the form $a'x'^2+c'y'^2+d'x+e'y'+f'=0$.

That becomes $a'(x'^2+x'd'/a')+c'(y'^2+y'e'/c')+f'$. Complete the square to get an expression of the form $a'(x+r')^2+b'(y+s')^2+t'=0$

In this form, the semimajor axis is the larger of $1/\sqrt{a'}$ and $1/\sqrt{b'}$. The remaining one is the semi-minor axis. The centers are d'/a' and e'/c'