I'm trying to calculate the distance between points taken from a .tcx file (i.e. with latitude and longitude) when the attribute DistanceMeters
is not present. In doing this I used as a test some .tcx with that attribute and I cannot obtain the same distance. I'm aware of the Haversine function (it overshoots in the found implementations btw), I'm aware of distance between GeoJSON (it overshoots using , again). Other tips and suggestions are welcome!
These are 3 points that I used as a benchmark (redacted with only the useful bits).
<Trackpoint>
<Time>2020-11-05T17:26:33.000Z</Time>
<Position>
<LatitudeDegrees>45.809465954080224</LatitudeDegrees>
<LongitudeDegrees>9.09074085764587</LongitudeDegrees>
</Position>
<AltitudeMeters>220.1999969482422</AltitudeMeters>
<DistanceMeters>0.0</DistanceMeters>
</Trackpoint>
<Trackpoint>
<Time>2020-11-05T17:26:35.000Z</Time>
<Position>
<LatitudeDegrees>45.80945455469191</LatitudeDegrees>
<LongitudeDegrees>9.090738091617823</LongitudeDegrees>
</Position>
<AltitudeMeters>220.1999969482422</AltitudeMeters>
<DistanceMeters>0.019999999552965164</DistanceMeters>
</Trackpoint>
<Trackpoint>
<Time>2020-11-05T17:26:40.000Z</Time>
<Position>
<LatitudeDegrees>45.80951012670994</LatitudeDegrees>
<LongitudeDegrees>9.090708252042532</LongitudeDegrees>
</Position>
<AltitudeMeters>220.0</AltitudeMeters>
<DistanceMeters>6.46999979019165</DistanceMeters>
</Trackpoint>