Solution of the equations of rotational motion for a class of torque-free gyrostats