def rotate_axes(xs, ys, zs, zdir):
 if (zdir == u'x'):
  return (ys, zs, xs)
 elif (zdir == u'-x'):
  return (zs, xs, ys)
 elif (zdir == u'y'):
  return (zs, xs, ys)
 elif (zdir == u'-y'):
  return (ys, zs, xs)
 else:
  return (xs, ys, zs)

def rotate_axes ( xs , ys , zs , zdir ) : if ( zdir == u'x' ) : return ( ys , zs , xs ) elif ( zdir == u'-x' ) : return ( zs , xs , ys ) elif ( zdir == u'y' ) : return ( zs , xs , ys ) elif ( zdir == u'-y' ) : return ( ys , zs , xs ) else : return ( xs , ys , zs )
reorder coordinates so that the axes are rotated with zdir along the original z axis .