def base_vectors(n):
 n = (n / np.sqrt(np.square(n).sum(axis=(-1))))
 if (abs(n[0]) == 1):
  l = np.r_[(n[2], 0, (- n[0]))]
 else:
  l = np.r_[(0, n[2], (- n[1]))]
 l = (l / np.sqrt(np.square(l).sum(axis=(-1))))
 m = np.cross(n, l)
 return (n, l, m)

def base_vectors ( n ) : n = ( n / np . sqrt ( np . square ( n ) . sum ( axis = ( - 1 ) ) ) ) if ( abs ( n [ 0 ] ) == 1 ) : l = np . r_ [ ( n [ 2 ] , 0 , ( - n [ 0 ] ) ) ] else : l = np . r_ [ ( 0 , n [ 2 ] , ( - n [ 1 ] ) ) ] l = ( l / np . sqrt ( np . square ( l ) . sum ( axis = ( - 1 ) ) ) ) m = np . cross ( n , l ) return ( n , l , m )
returns 3 orthognal base vectors .