For the case of a 2x2 matrix, there is a simple analytical solution.
Your function should implement the solution presented at this link, with the three subcases. You may want to normalize the eigenvectors to unitary modulus as an additional step at the end.