I am trying to develop a program for my ship in order to be able to know what is the azimut of the ships around him. Yet, I don't know how to calculate the azimut given my own position which is the first latitude-longitude couple and the "enemy" position.
For instance, being in $47°59'N,1°44W$ and watching an aircraft carrier in $47°23'N,1°12E$, how may I found the azimut of the aircraft carrier from my own position?
Can you help me figuring it out?
A sub question would be about calculating its distance, it is like calculating the distance between two points. Yet, it is in degree, minutes and seconds...
There is a spherical trigonometric formula that gives $\tan(\text{Bearing})$ as $$ \frac{\cos(\text{Latitude B})\sin(\Delta\text{Longitude})}{\cos(\text{Latitude A})\sin(\text{Latitude B})-\sin(\text{Latitude A})\cos(\text{Latitude B})\cos(\Delta\text{Longitude})}\tag{1} $$ The Spherical Law of Cosines gives $\cos(\text{Distance})$ as $$ \sin(\text{Latitude A})\sin(\text{Latitude B})+\cos(\text{Latitude A})\cos(\text{Latitude B})\cos(\Delta\text{Longitude})\tag{2} $$ Once we have computed the Distance, we can use the Spherical Law of Sines to compute $$ \sin(\text{Bearing})=\frac{\sin(\Delta\text{Longitude})\cos(\text{Latitude B})}{\sin(\text{Distance})}\tag{3} $$ Equation $(3)$ will remove any uncertainty in the quadrant of Bearing as computed in $(1)$.
Using the Spherical Law of Cosines, we can also compute $$ \cos(\text{Bearing})=\frac{\sin(\text{Latitude B})-\sin(\text{Latitude A})\cos(\text{Distance})}{\cos(\text{Latitude A})\sin(\text{Distance})}\tag{4} $$ Note that $(2)$, $(3)$, and $(4)$ can be combined to obtain $(1)$.