[NLRS] Computing distances for 10G contest

John P. Toscano tosca005 at tc.umn.edu
Sat Sep 24 23:53:38 EDT 2005


Whew, a lot of traffic on that subject.  And I guess I am to blame (at 
least partly) for setting up the hornet's nest that got kicked over, by 
creating a logging spreadsheet that computes the distances for you.  I 
guess the old saying is true, "No good deed goes unpunished."  :)

The reason that my spreadsheet sometimes gives different numbers than 
(insert your method of choice here) is that all these different methods 
use different algorithms to compute the distance.  It is not a rounding 
issue, although that has been discussed.  As already pointed out, there 
is a little finesse required for rounding correctly, and rounding a 
number that has already been rounded is generally a bad thing to do. 
But, as I said, the problem is not rounding.

I used a program from the ARRL's "Radio Amateur's Satellite Handbook", 
(c) 1998, Appendix D, called DISTBEAR.BAS (a BASIC program for computing 
distance and bearing).  This is the same algorithm I used in my Palm 
Pilot program called GridLoc.  The original program does not cite any 
source for the algorithm.  I don't understand the algorithm itself well 
enough to say for sure, but it is POSSIBLE that it assumes that the 
earth is a sphere, which, of course, is a simplificatin of the actual case.

BD2000 and BD2004 use a different algorithm from mine.  (I think that 
there was a version BEFORE 2000 that had "small errors at edges of grid 
squares", but the only difference between the 2000 and the 2004 versions 
is the way you exit the program, not how the calculations are 
performed.)  The source code specifically states that it "determines 
bearing and distance based on algorithm compensating for earth's shape", 
and the authors cite as a source "Thomas, P.D., 1970, Spherical 
Geodesics, reference systems and local geometry, U.S. Naval 
Oceanographic Office SP-138, page 165".

GL, as far as I can tell, uses yet a different algorithm from the other 
two.  The author states that it is "based on code from PROJ.4 1995 by 
Gerald I. Evenden, US Geological Survey, Woods Hole, MA 02543".  It can 
be set to compute the distances (and bearings) using the WGS84 
coordinate system, the NAD27 coordinate system, or by assuming that the 
Earth is a sphere.  The default is WGS84.

So which algorithm is "correct"?  Beats the heck out of me.  Donn puts 
more faith in the method used by GL, and I'd be curious to know the 
basis of that.  (I'm not trying to be argumentative or disputing his 
choice, I'm trying to learn something.)  I have to admit that I made the 
"mistake" of coding my spreadsheet according to an algorithm published 
in an ARRL publication, checking some sample cases against another 
source (GL), and when they seemed to match up, I assumed the code I 
wrote was correct.  I've written enough software over the decades to 
know that that's a dangerous assumption, but that's what happened.

Now, if it was a random difference, sometimes + and sometimes -, then I 
guess it would be nothing to worry about.  The problem is that the 
method I used has a clear bias of calculating a smaller number than 
BD2000, BD2004, or GL.  In my own log, the difference over 500 QSO's 
(including one dupe that needs to come out), is 92,257 points (my 
spreadsheet based on the AMSAT program) vs. 92,457 points (using the GL 
method), or a full 200 points.  Ok, it averages out to a measly 0.4 
points per QSO or 0.2168% of my originally-calculated score.  So I guess 
my method was pretty close, but on the other hand, 200 points is 200 points.

So, here's the deal.

I have modified my spreadsheet once again to use the GL method of 
computing distances.  (You don't think I computed the difference in 
scores by hand, do you!??)  If you have used my prior spreadsheet, and 
would like to have your existing data put into the new version of the 
spreadsheet to take advantage of the higher points possible, I am 
willing to do the conversion for you.  If you'd rather not send me your 
log, but you would like to copy your data into the new version, I will 
send you a blank copy.  You need to use some finesse in copying your 
data from the old spreadsheet to the new one, because there are some 
"hidden columns" in the old spreadsheet that complicate the copy 
process.  If you are real familiar with Excel, you probably already know 
what to do.  If not, I can try to explain it to you.

Sorry for any confusion.

P.S., I will use the GL method in my submission.  The extra 200 points 
almost make up for the 221.914 (oops, I mean 222) point dupe.  And NO, 
it is not a secret plot to cheat the rest of you out of a couple of 
hundred points.  This will *NOT* move me any higher in the standings, at 
least not among the locals.  Even if you have already submitted a log, 
it is not too late to submit a corrected log.

73, John (W0JT)


More information about the NLRS mailing list