V
V
Vladimir Maltsev2018-04-13 22:16:57
satellite navigation
Vladimir Maltsev, 2018-04-13 22:16:57

How to determine the direction (N/S/W/E) of movement using two GPS coordinates?

There are two GPS coordinates (lat,lon,timestamp).
a 45.0677975, 41.9269341, 1523639370
b 45.0688700, 41.9279653, 1523639381
How to calculate the heading azimuth (vector, direction) from these data?
The bottom line is this, there is a GPS track with an array of coordinates and a timestamp - it is necessary to determine from it when the source turned (left from the previous direction to another direction).

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2018-04-13
@NeiroNx

As an angle between vectors it is considered. a unit vector along the y-axis and a vector formed by two points.
kak_najti_kosinus_ugla_mezhdu_vektorami1

M
Moskus, 2018-04-13
@Moskus

https://en.wikipedia.org/wiki/Azimuth

S
Sencis, 2020-05-04
@Userpc0101

For example like this:

double res_1 =  /* Направление */  45.132982 - 45.117557, res_2 =  /* Направление */ 41.946420 - 41.946270;

 output = atan2( res_2, res_1 );

Depending on the difference (permutation of reduced and subtracted) points, atan2 will give an azimuth from the specified line, and then you can postpone any side of the light from the resulting azimuth.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question