Typically bearings are given from a reference [North or South] and deflecting East or West.
From the information given, assume the reference for zero bearing is due North or the y-axis; and assume that port A is at the origin (0,0).
Since & The distance AB is
The bearing is the arctangent of the difference between final coordinates and the initial coordinates:
The tangent of the bearing AB is :
As a check: