def get_perpendicular_vector(v):
 if (v[0] == v[1] == v[2] == 0):
  logger.error('zero-vector')
 if (v[0] == 0):
  return np.array((1, 0, 0))
 if (v[1] == 0):
  return np.array((0, 1, 0))
 if (v[2] == 0):
  return np.array((0, 0, 1))
 return np.array([1, 1, (((-1.0) * (v[0] + v[1])) / v[2])])

def get_perpendicular_vector ( v ) : if ( v [ 0 ] == v [ 1 ] == v [ 2 ] == 0 ) : logger . error ( 'zero-vector' ) if ( v [ 0 ] == 0 ) : return np . array ( ( 1 , 0 , 0 ) ) if ( v [ 1 ] == 0 ) : return np . array ( ( 0 , 1 , 0 ) ) if ( v [ 2 ] == 0 ) : return np . array ( ( 0 , 0 , 1 ) ) return np . array ( [ 1 , 1 , ( ( ( - 1.0 ) * ( v [ 0 ] + v [ 1 ] ) ) / v [ 2 ] ) ] )
finds an arbitrary perpendicular vector to *v* .