Surf-riding and oscillations of a ship in quartering waves