Given the movement of the ship, it can be respresented by the image below:
The distance from its starting point in a direct line is represented with x and can be calculated using Pythagoras Theorem as follow:
To get the hypotenuse, we have:
Hence, the ship is approximately 19.9km away from the starting point in a direct line.