B
B
bogdan_242015-01-02 23:16:50
Python
bogdan_24, 2015-01-02 23:16:50

Calculation of the distance traveled written in gpx. How to implement in Python?

I decided to write a program that displays the distances recorded in gpx, I figured out the parsing. When calculating large discrepancies in the results.
formulas:
r = radius of the Earth in meters = 6378245
x = r * sin(W) * cos(L);
y = r * sin(W) * sin(D);
z = r * cos(W);
Distance between two points on a sphere = sqrt((x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zed, 2015-01-02
@bogdan_24

This is called the "Inverse Geodesic Problem".
Here there is a detailed theory and ready-made python scripts for the sphere : Problems on the sphere: inverse geodesic problem . And there is also a good geographiclib that solves these problems on an ellipsoid .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question