Most GPS receivers, as well as Smartphones or Google Maps, providing position information in decimal degrees.
[math]lat =\phi=51.03408[/math][math]lon =\lambda=13.73979[/math]
Most calculations, for example most Kalman Filter implementations, need SI-units like meter. The question is: What is the conversion between decimal degrees to meters and back?
Assuming short distances, the Pythagoras can provide a good solution
The measured values are angles from the equator (latitude) and from the meridian through Greenwich (England). Actually, one have to take a Great Circle Formula or Haversine Formula for correct calculation, but for small distances, it is ok to take a simple Pythagoras calculation.
The error made with this assumption is pretty small for small distances, as shown in the following figures:
For example, one filter step of a Kalman filter takes about 1/50 of a second. Even if the car is driving with 150m/s, it can travel 3m in one filter step.
One Degree in Meter
The question is: How to convert between the Degree (Latitude or Longitude) to meters. The world on equator is a 360° circle and have a radius, lets assume R=6378km, then one degree of longitude at altitude h=0m is
[math]arc_\text{Lon} = \cfrac{2 \cdot \pi\cdot (R+h)}{360^\circ} = 111.323872 km/^\circ[/math]
But one degree in latitude is just 111.32km on the equator. If you move to the pole, the value decreases until it is 0km on north- or southpole. So you have to take the cosine of latitude to calculate the value of reduction.
[math]\Delta x = arc\cdot\cos(\phi)\cdot\Delta \lambda[/math]
[math]\Delta y = arc\cdot\Delta \phi[/math]
With Delta Values as the difference between two position measurements out of the GPS receiver. The distance traveled is simply the Pythagoras of both Delta values
[math]d=\sqrt{\Delta x^2 + \Delta y^2}[/math]
Convert between Meters and Lon/Lat
The simple the conversion between Lat/Lon and meters was, the simple the back conversion is:
[math]\Delta \phi = \cfrac{\Delta y}{arc}[/math]
[math]\Delta \lambda = \cfrac{\Delta x}{arc \cdot \cos{\phi}}[/math]
Example for long distance Error
If you have a long distance, for example Berlin to Lisbon, then the Pythagoras calculation made an error of -17.682km (0.764%) against the Haversine formula.
Take a look at this side for Python implementation of Haversine.