iOS Question What's the difference between heading and bearing?

Albi

Active Member
Licensed User
After using B4A I thought that heading was the direction (in degrees) you are facing, and bearing was direction (in degrees) to a target.

The B4i tutorial has only 1 location in it, and the results sometimes give a bearing. What is this bearing??

The reason I ask is because I'm trying to do a bearingTo.

This is the bearing code in the tutorial:
B4X:
lblBearing.Text = ValueOrNA (Location1.Bearing, 1, Chr(176))
I thought that changing location1 to targetLocation would work. I don't think it does, so I think I don't understand bearing.
I think I've set up my targetLocation ok because
B4X:
Location1.DistanceTo(targetLoc)
works fine.

I am aware of the other thread about this here http://www.b4x.com/android/forum/threads/calculate-bearing-to-other-location.46513/#post-291737 and am currently going through it trying to understand what is going on. eg what the variable cPI is (edit in case anyone else gets here looking for cPI - this is the B4x constant for Pi)
 
Last edited:
Top