Another way, if you only want the pipe to rotate and not move is to install a guide and limit stop with zero gaps. This way you don't need to worry about directional co-sines.
_________________________
Miss Itchy