Calculate bearing between two locations (lat, long)

后端 未结 7 1676
不知归路
不知归路 2020-12-13 20:35

I\'m trying to develop my own augmented reality engine.

Searching on internet, I\'ve found this useful tutorial. Reading it I see that the important thing is bearing

7条回答
  •  醉话见心
    2020-12-13 20:44

    In the formula

    float possibleAzimuth = (M_PI * .5f) - atan(latitudinalDifference / longitudinalDifference);

    the term (M_PI * .5f) means π/2 which is 90°. That means that it is the same formula that you stated at first, because regarding to the figure above it holds

    β = arctan (a/b) = 90° - arctan(b/a).

    So both formulas are similar if a refers to the difference in longitude and b in the difference in latitude. The last formula calculates again the same using the first part of my equation.

提交回复
热议问题