you can use this formula to get angle between to lat longs have a look.
θ = atan2(sin(Δlong)*cos(lat2), cos(lat1)*sin(lat2) − sin(lat1)*cos(lat2)*cos(Δlong))
Note that the angle(θ) should be converted to radians before using this formula and Δlong = long2 - long1.
atan2 is a common function found in almost all programming languages (mostly in the Math package). Usually there is also functions for conversion between degrees and radians(also in the Math package).
Remember that atan2 returns values in the range of -π ... +π, to convert the result to a compass bearing, you need to multiply θ by 180/π then use (θ+360) % 360, where % is modulus division operation returning the remainder of the division.
The following link is a good resource for formulas involving latitudes and longitudes. They also provide Javascript implementation of their formulas. In fact the answer is based on the information from this page: