neologist wrote:If we assume that the ship is traveling on a course perpendicular to the line between the harbor and lighthouse
What is the basis for this assumption? This assumption is inconsistent with the other data presented.
Directly may not have meaning in geometry or trig, but it has a real world meaning that, in this case, is easily translated to geometry: The ship travels on a straight line toward the harbor.