I have two positions in terms of latitude and longitude (in degrees) , I need to calculate the Heading from these two points. I am comparing my heading with a High precision GPS Receiver which gives me heading values .
The algorithm I got from Internet after implementation gives me a variation of 4 degrees. The algorithm can be found at
http://www.movable-type.co.uk/scripts/latlong.html
I am getting a difference of 4 degrees only when the vehicle goes in a straight path..
As you can see in picture , the Blue is from High precision GPS Recevier (cm level RTK), and Orange is Haversine heading caluculations. While vehicle turns , heading is completely deviated ,,, But at least when vehicle is along the straight path , I am getting on off by 4 degrees approx..
Please let me know if you have any questions. Any help or direction would be appreciated.