Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. About the bearing calculation for map
Forum Updated to NodeBB v4.3 + New Features

About the bearing calculation for map

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 754 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aktay
    wrote on last edited by
    #1

    Dear All,

    I'm trying to make navigate. But I have no idea how to use the bearing feature. How should I calculate the bearing, what conditions should I consider when calculating, and what should my calculation criteria be?

    Any idea on this issue?

    Thanks.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What do you mean by "make navigate" ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        What do you mean by "make navigate" ?

        A Offline
        A Offline
        aktay
        wrote on last edited by aktay
        #3

        @SGaist

        Sorry , I mean navigation. I've already solved the problem.

        I am using the following JavaScript code.

                var firstLatitude=deg2rad(latitudeArray[latitudeArray.length-2]);
                var firstLongtitude=deg2rad(longtitudeArray[longtitudeArray.length-2]);
                var endLatitude=deg2rad(latitudeArray[latitudeArray.length-1]);
                var endLongtitude=deg2rad(longtitudeArray[longtitudeArray.length-1]);
                var diffLongtitude=(endLongtitude-firstLongtitude);
                var x=Math.sin(diffLongtitude)*Math.cos(endLatitude);
                var y=Math.cos(firstLatitude)*Math.sin(endLatitude)-Math.sin(firstLatitude)*Math.cos(endLatitude)*Math.cos(diffLongtitude);
                var bearing =(rad2deg(Math.atan2(x,y)));
              if(bearing!=0){
                angleData=bearing;
        }
        
        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved