Forums > Windsurfing   Gps and Speed talk

How do Realspeed, GPSResults calc TP Distance?

Reply
Created by Dylan72 > 9 months ago, 24 Jan 2009
Dylan72
QLD, 660 posts
25 Jan 2009 12:39AM
Thumbs Up

I've been looking at refining the Alpha500 calcs for Trackpoints at the ka72 site, and running again and again into discrepancies between my own calculations of distance between two points, and the results from these programs.

So I was wondering how Realspeed and the other programs calculate the distance between two points?

For instance, I have two points in a track that are:
Lat1: -26.8169905
Long1: 153.1287358
Lat2: -26.8170081
Long2: 153.1288241

Now, my calculations say that the distance between these two points is 8.97843m

However, Realspeed calculates the difference at 8.992m. GPSResults (which only seems to display 1 decimal point accuracy) says 9.0m.

When I plug the same coordinates into a web-based distance calculator (like the one at www.movable-type.co.uk/scripts/latlong.html) it gives me a distance of 8.978m, the same as my code

These tiny differences in distance calculation are leading to small but significant differences in Alpha 500 calculations. I can't work out whether I am wrong, or RealSpeed/GPSResults is wrong. I would like to think that the speed apps have it right, but I can't find a calculation that agrees with their results.

The only thing I can think is that they are either:
a) using a different formula than me or
b) building in some kind of correction for curvature between two points (I am calculating a straight line, but you don't tend to sail through a gybe in a series of short straight lines.)

Dylan.



Paul Kelf
WA, 678 posts
25 Jan 2009 10:15AM
Thumbs Up

I'm no genius but think you would have to take the curves into account.

Each point will be 2 seconds apart and you know how far between them in a straight line so you then need to find the radius of each section between th 2 sec points and then the circumference between the points.

The only way I know to do this is to bisect each radius section and where the centerlins cross is the centre of the radius, this will be a radius across 3 points.
Work out the angle between the 3 points from the centre of the radius and calculate the circumference base on the radius & angle.

This will not be 100% as you are assuming the radius between 3 points and not between 2 points but you may be able to overlap to minimise the error.

Hope that makes sense, if not I may be able to draw it for you.

TimeMachine
89 posts
25 Jan 2009 10:36AM
Thumbs Up

RealSpeed uses the Vincenty method of calculation. Here is the original paper on the method:

www.ngs.noaa.gov/PUBS_LIB/inverse.pdf

And a test (and code) so you can plug in your values to test the results:

www.movable-type.co.uk/scripts/latlong-vincenty.html

NotWal
QLD, 7430 posts
25 Jan 2009 7:53PM
Thumbs Up

TimeMachine said...

RealSpeed uses the Vincenty method of calculation. Here is the original paper on the method:

www.ngs.noaa.gov/PUBS_LIB/inverse.pdf

And a test (and code) so you can plug in your values to test the results:

www.movable-type.co.uk/scripts/latlong-vincenty.html



That appears to be about geodesic curves. Such precision - love it.

Dylan72
QLD, 660 posts
25 Jan 2009 8:14PM
Thumbs Up

TimeMachine said...

RealSpeed uses the Vincenty method of calculation.


Thanks very much! This will be very useful.

Ta,

Dylan.

Dylan72
QLD, 660 posts
25 Jan 2009 10:46PM
Thumbs Up

OK, I think I have figured it out.

It seems that Realspeed ignores the first speed value in the list when calculating the average speed for a set of values.

So, if I had a bunch of waypoints like this (assuming they are all 1 second):
Speed
17.5
21
20
21
22
19

Then Realspeed calculates the average speed as 20.6, the average of the last five values, and appears to ignore the 17.5.

I'm not sure why this is, but it appears to take the Total Distance of the last point, and subtract the Total Distance of the first point (which is the total distance at the "end" of that point, not at the beginning.)




Subscribe
Reply

Forums > Windsurfing   Gps and Speed talk


"How do Realspeed, GPSResults calc TP Distance?" started by Dylan72