def _get_plane_vectors(ez):
 assert (ez.shape == (3,))
 ez_len = np.sqrt(np.sum((ez * ez)))
 if (ez_len == 0):
  raise RuntimeError('Zero length normal. Cannot proceed.')
 if (np.abs((ez_len - np.abs(ez[2]))) < 1e-05):
  ex = np.array([1.0, 0.0, 0.0])
 else:
  ex = np.zeros(3)
  if (ez[1] < ez[2]):
   ex[(0 if (ez[0] < ez[1]) else 1)] = 1.0
  else:
   ex[(0 if (ez[0] < ez[2]) else 2)] = 1.0
 ez /= ez_len
 ex -= (np.dot(ez, ex) * ez)
 ex /= np.sqrt(np.sum((ex * ex)))
 ey = np.cross(ez, ex)
 return (ex, ey)

def _get_plane_vectors ( ez ) : assert ( ez . shape == ( 3 , ) ) ez_len = np . sqrt ( np . sum ( ( ez * ez ) ) ) if ( ez_len == 0 ) : raise RuntimeError ( 'Zero length normal. Cannot proceed.' ) if ( np . abs ( ( ez_len - np . abs ( ez [ 2 ] ) ) ) < 1e-05 ) : ex = np . array ( [ 1.0 , 0.0 , 0.0 ] ) else : ex = np . zeros ( 3 ) if ( ez [ 1 ] < ez [ 2 ] ) : ex [ ( 0 if ( ez [ 0 ] < ez [ 1 ] ) else 1 ) ] = 1.0 else : ex [ ( 0 if ( ez [ 0 ] < ez [ 2 ] ) else 2 ) ] = 1.0 ez /= ez_len ex -= ( np . dot ( ez , ex ) * ez ) ex /= np . sqrt ( np . sum ( ( ex * ex ) ) ) ey = np . cross ( ez , ex ) return ( ex , ey )
get two orthogonal vectors orthogonal to ez .