Full explaination and answer to this trigonometric question

**A ship sailing due north at a speed of 20km/h observes another ship which appears, to those on the first ship, to be travelling north-west at 10km/h. Draw a diagram and find the true speed and direction of motion of the second ship.**

This is the explanation that I have been given and that I do not fully understand

Let the 1st ship be A the second ship be B and

ship B is actually travelling at v km/h in the direction

of N x* W. Then

v^2=10^2+20^2-2(10)(20)cos(45+90)*=>

v^2=641.4213562=

v=25.3263 km/h approximately.

10/sinx=25.3263/sin(90+45)*=>

x=16*12'44.5"

So the second ship (B) is travelling at 25.3263 km/h

in the direction N 16*12'44.5" W.