When we represent what is given to us on a coordinate plane, we have a figure as shown in the attachment.
To find the distance between P and R, we have to find the Net Displacement of the ship (brown arrow in the figure).
For that, we use the rules for Vector addition.
We see that the first displacement = 30 km (blue arrow) is along the y-axis, but the second part of the ship's journey = 20 km (red arrow) is at an angle with reference to y-axis.
So, we first find the components of the red arrow along X and Y.
Component of along X-axis is given by = 10 km
Component of along Y-axis is given by = 17.32 km
We now add all the vectors along X and along Y separately.
Net Displacement along X
Net Displacement along Y = 47.32 km
Now that we have the components of the net displacement along X and Y, we make use of Pythagorean Theorem to calculate the
Therefore, [tex]D_{net} = 48.37 km.
Hence, the distance between the ports P and R is 48 km.