Calculate bearing between two locations (lat, long)

后端 未结 7 1551
不知归路
不知归路 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 21:04

    a in the diagram is the longitude difference, b is the latitude difference therefore in the method you have written you've got them the wrong way round.

    a = destination.latitude - user.latitude; // should be b
    b = destination.longitude - user.longitude; // should be a
    

    Try switching them and see what happens.

    See Palund's response for answers to the rest of your questions.

    0 讨论(0)
提交回复
热议问题