Two ship leave port at the same time one travel at 5km/h on a bearing of 046 the other travel 9km/h on a bearing of 127 how far apart are the ship after 2 hours

use the law of cosines.

The angle between the two headings is 81°, so the distance z is
z^2 = (5*2)^2 + (9*2)^2 - 2(5*2)(9*2)cos81°