I have a problem with calculation angle between lines created by connecting three geopoints.
p1
\ p2
\ /
p3
I implemented many solutions but not gave me expected result. For example I used law of cosinuses Direct way of computing clockwise angle between 2 vectors . I also used equation
angle = atan2(vector2.y, vector2.x) - atan2(vector1.y, vector1.x).
Each method returned the same incorect result.
For example I have three points:
p3 latitude=52.66346360584388, 19.056108732273625
p1 latitude=52.66321959338828, 19.056379848488714
p2 latitude=52.66348185383115, 19.05648061759354
Law of cosinuses and atan2 returned angle 44.797 degrees. When I marker this points in google maps and measure the angle in gimp program I have about 57 degrees. In other sets of points the differences are the same or greater. What am I doing wrong?