Go through the Gimbal & Hinged Expansion Joint, you can find the solution for your question.
_________________________
Moorthy