In an exam question I was asked to calculate the eigenvalues of $A^\top A$, where $A = (a_1\ a_2\ a_3); a_1=(0\ 2\ 1)^\top; a_2=(1\ -1\ 1)^\top; a_3=(1\ 1\ -1)^\top;$ and $A^\top$ stands for the transpose of $A$.
By mistake I calculated $AA^\top$ instead of $A^\top A$, and I got a diagonal matrix whose diagonal entries are 2, 3, 6, which are equal to the eigenvalues of $A^\top A$.
My question is whether this is a coincidence; that is, whether the eigenvalues of $A^\top A$ are equal to those of $AA^\top$.