Answer:
5.65 km at 350.5° (or N 9.5° W)
Explanation:
You want the distance and bearing from D to A, when D is at the end of path ABCD with path lengths AB=4km E, BC=3 km S, CD=4 km S 50° W.
Geometry
The geometry of the problem is shown in the first attachment. Using point A as the origin, the location of point D is ...
D = (0, 0) +(4, 0) +(0, -3) +4(cos(-140°), sin(-140°)) . . . . angle from +x axis
D = (4 +4cos(-140°), -3+sin(-140°)) ≈ (0.935822, -5.57115)
Then the bearing angle from D to A is ...
∠DA = arctan(-0.935822/5.57115) ≈ -9.54° . . . . angle CW from north.
This is N 9.54° W, or 350.46°
The distance from D to A is found using the Pythagorean theorem:
DA = √((-0.935822)² +(5.57115)²) ≈ 5.64920 . . . . km
A from D is 5.65 km at N 9.5° W
Calculator
The same calculation can be done with a scientific or graphing calculator that works with complex numbers. As long as bearing angles are consistently used, the calculation will give a bearing angle as a result. This is quite convenient.
The second attachment shows that A from D is 5.65 km at N 9.5° W.
__
Additional comment
The coordinates used in the Geometry section above are (E, N) coordinates, corresponding to overlaying a map with a Cartesian coordinate system. The angle -140° is measured in that system as positive CCW from the +x axis. The bearing angle S50W is 50° more negative than -90° in that coordinate system.
When converting (x, y) coordinates to bearing angles, we have some choices. We can use a (North, East) coordinate system and compute the angles more or less directly in the usual way. Or, we can use the (E, N) coordinate system of a map overlaid with Cartesian coordinates, and subtract the resulting angle from 90°. In the calculation above, we chose the first of these methods.
The arctangent function will return an angle in the range -90° to +90°. In our (N, E) coordinate system, positive angles will be east of north (NxxE) or west of south (SxxW). We have a bearing with a positive North coordinate, and a negative E coordinate. That means the angle can be described as one that is NxxW, as we have done.
The →Polar function used by the calculator returns angles in the range -180° < θ ≤ 180°. If positive bearing angles in the range 0 ≤ θ < 360° are wanted, then 360° must be added to any negative angles returned by the →Polar function.