The captain should set a bearing of approximately 64.46 degrees to sail directly to the harbor.
To determine the bearing, we can use trigonometry.
The ship forms a right-angled triangle with sides of 7 miles (west) and 12 miles (south).
The tangent of the angle (bearing) is given by the opposite side (7 miles) divided by the adjacent side (12 miles).
Using the arctangent function, we find the angle to be approximately 29.74 degrees.
However, since the harbor is to the east, we subtract this from 90 degrees to get the final bearing of approximately 64.46 degrees.
So, the captain should set a bearing of approximately 64.46 degrees to sail directly to the harbor, ensuring an efficient and accurate navigation path.