Func_rotate_train