I have a Fortran subroutine that calculates eigenvalues and eigenvectors of a symmetric $3 \times 3$ matrix. The eigenvector corresponding to an eigenvalue are calculated and then they are normalized dividing each component by the length. In the subroutine, when the calculated length is close to zero (i.e. it is lower than a specified tolerance) the eigenvector is set to $[1, 0, 0]$ or $[0,1,0]$ or $[0, 0, 1]$ if it corresponds to the first, the second or the third eigenvalue respectively. I cannot see the mathematical justification for that, can anyone clarify this?