Numerical computation of ship motions in directional seas. Part I. Frequency domain analysis