Diagonal matrices - order of eigenvalues, eigenvalues and the resulting diagonal elements? Consider matrix $A=\left[\begin{matrix}1 & -2\\-2 & 1\\\end{matrix}\right]$, with characteristic equation $\begin{vmatrix}1-\lambda & -2\\-2 & 1-\lambda\\\end{vmatrix}=(\lambda+1)(\lambda-3)$
$\lambda_1=-1$ gives eigenvector $\begin{bmatrix}1\\1\\\end{bmatrix}$
and $\lambda_2=3$ gives eigenvector $\begin{bmatrix}-1\\1\\\end{bmatrix}$, resulting in $P=\begin{bmatrix}1&-1\\1&1\\\end{bmatrix}$
$D=P^TAP=\begin{bmatrix}1&1\\-1&1\\\end{bmatrix}\begin{bmatrix}1&-2\\-2&1\\\end{bmatrix}\begin{bmatrix}1&-1\\1&1\\\end{bmatrix}$ gives me $D=\begin{bmatrix}-1&0\\0&3\\\end{bmatrix}$
But, the answer tells me it's supposed to be $D=\begin{bmatrix}3&0\\0&-1\\\end{bmatrix}$
Does the order of eigenvalues and eigenvectors make a difference? If so, how? 
Or is both of the resulting $D$ "equal" and correct? Also, maybe I made a mistake somewhere...
Thank you!
 A: 
Or is both of the resulting $D$ "equal" and correct? Also, maybe I made a mistake somewhere...

Your answer is fine too, but it doesn't only change $D$, it's connected with $P$:

Does the order of eigenvalues and eigenvectors make a difference? If so, how? 

The order of the eigenvalues on the diagonal in $D$, match the order of the corresponding eigenvectors in the columns of $P$ : if eigenvector $\vec v_i$ is in the $i$-th column of $P$, then the corresponding eigenvalue $\lambda_i$  is on the $ i$-th (diagonal) position in $D$ and vice versa.
A: $D_1=\left(\frac1{\sqrt{2}}\begin{bmatrix}1&1\\-1&1\\\end{bmatrix}\right)\begin{bmatrix}1&-2\\-2&1\\\end{bmatrix}\left(\frac1{\sqrt2}\begin{bmatrix}1&-1\\1&1\\\end{bmatrix}\right)$ gives me $D_1=\begin{bmatrix}-1&0\\0&3\\\end{bmatrix}$
$D_2=\left(\frac1{\sqrt2}\begin{bmatrix}-1&1\\1&1\\\end{bmatrix}\right)\begin{bmatrix}1&-2\\-2&1\\\end{bmatrix}\left(\frac1{\sqrt2}\begin{bmatrix}-1&1\\1&1\\\end{bmatrix}\right)$ gives me $D_2=\begin{bmatrix}3&0\\0&-1\\\end{bmatrix}$
Yes, the order matters, also remember to normalize your matrix if you want them to be orthogonal. 
The $i$-diagonal entry correspond to the $i$-th column of $P$.
