The motions of a moored ship in waves