Let $F_1$, $F_2$ be the foci points of an ellipse $\mathcal{E}\colon \mathbf{x}^TA\mathbf{x}=1$, $\mathbf{x}\in\mathbb{R}^2$, $A\in\mathbb{S}_{++}^{2}$. Let also $a$, $b$ be the semi-axes of $\mathcal{E}$. We would like to find the (symmetric positive-definite) matrix $A$.
I tried the following:
I first constructed the diagonal matrix $D=\operatorname{diag}\{a^{-2},b^{-2}\}$. Then I cunstructed the orthogonal matrix $U=[\mathbf{u}_1\:\:\mathbf{u}_2]$, where $\mathbf{u}_1=F_1F_2$ and $\mathbf{u}_2\perp\mathbf{u}_1$, specificaly $\mathbf{u}_2 = (-u_{12},u_{11})^T$.
Finally I got $A=UDU^T$. But when I use Matlab's eig() function to get again the eigenvalues and the eigenvectors, while I get correctly the eigenvalues, I get the opposite of the eigenvectors.
What is the error here? Thanks a lot!