In that case i would implement a check to see if the length of xAxis is either zero or very close to zero after crossing zAxis and up.

If it is too close to zero you could just set it to a default of 1,0,0.