Search code examples
arduinobearing

Bearing angle and distance between heading and target point


I'd like to calculate the bearing angle and the distance between heading point and target point with three coordinates for an arduino navigation.

coordinates system looks something like this.

(x1, y1) = heading point, (x3, y3) = target point

Any help here ??


Solution

  • All calculation methods can be found at this site.

    Notice that for distance you can have Haversine calculation (less precise) or Vincent calculation (excelent precision - check the formula here)

    I'm using these formulas with GoogleMaps API and works pretty good.