# Eigenvector length close to zero

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?

• What is the algorithm? Is it an iterative method? – Omnomnomnom Aug 21 '15 at 17:10
• Nope, it is purely analytical. Eigenvalues are computed in closed form the matrix principal invariants, eigenvectors components are obtained by solving the homogenous system of linear equations and then normalized. Obviously, the solution of the system is trivial . – user2078621 Aug 21 '15 at 17:16
• My best guess is that dividing by too small a length leads to some kind of division by zero or NaN situation. In order to avoid this, it's better to give an arbitrary result than to let the error occur. – Omnomnomnom Aug 21 '15 at 17:20