1

I'm trying to calculate the initial bearing (forward azimuth) between two positions using latitude and longitude. After much googling most of what I can find either relates to calculating distance, or calculates using an equirectangular projection.

The closest I could find is the formula:

θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )

which when using excel needs to be reversed:

=ATAN2(COS(lat1)*SIN(lat2)-SIN(lat1)*COS(lat2)*COS(lon2-lon1),SIN(lon2-lon1)*COS(lat2))

The output should give me the answer in radians, which I convert to degrees using:

=MOD(DEGREES(answer)+360,360)

However I'm not getting anything that makes sense.

My test points are located in the southern hemisphere: -17.9467 122.2350 and -20.3783 118.6233

I should be getting an answer of about 232 degrees (there's 1-2 degrees of magnetic variation in this answer whereas the formula is in degrees True), however I'm getting 177 degrees.

Can anyone see my (probably simple) error?

1 Answer 1

1

Convert the original data to radians before using the formula.

1
  • You are absolutely correct. It never clicked in my head that the figures I entered for latitude and longitude were in decimal degrees!
    – Adam
    Mar 28, 2016 at 10:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.