In a gimbaled thrust system, the engine or just the exhaust nozzle of the rocket can be swiveled on two axes (pitch and yaw ) from side to side. As the nozzle is moved, the direction of the thrust is changed relative to the center of gravity of the rocket.
The diagram illustrates three cases. The middle rocket shows the straight-line flight configuration in which the direction of thrust is along the center line of the rocket and through the center of gravity of the rocket. On the rocket at the left, the nozzle has been deflected to the left and the thrust line is now inclined to the rocket center line at an angle called the gimbal angle. Since the thrust no longer passes through the center of gravity, a torque is generated about the center of gravity and the nose of the rocket turns to the left. If the nozzle is gimbaled back along the center line, the rocket will move to the left. On the rocket at the right, the nozzle has been deflected to the right and the nose is moved to the right.