Distance between geographic poimts


Around the HP-65 HP-67 era my boss had me calculate distances for his glider club. It was in the calculator book I was using, I shortened the program and made it automatic for crossing the equator. I have the manuals on CD and I request help finding that worked solution. If you could help me find the book and page please. Sam


I have an HP-42S program that computes Great Circle Distance here. Should be easy to adapt to the HP-65 or HP-67 or any other RPN scientific.

It takes coordinates in decimal degrees, so you may want to add ->HMS commands at a few places; it calculates the distance in kilometers, but that is easy enough to change to nautical miles by changing the final multiplication to 21600.

The formula used is

dist = acos(cos(lat1)*cos(lat2)*cos(lon1-lon2)+sin(lat1)*sin(lat2))

Where dist is an angle on the Great Circle passing through the two points. Assuming the calculator is in DEG mode, multiply by 60 to get nautical miles, etc. This formula works for any pair of coordinates -- no issues with crossing the equator or passing over the poles or anything like that.

UPDATE: There is more information, and more accurate formulae, here.

- Thomas

00 { 101-Byte Prgm }
01>LBL "GC"
02 MVAR "LAT1"
03 MVAR "LON1"
04 MVAR "LAT2"
05 MVAR "LON2"
07 DEG
08 RCL "LAT1"
09 COS
10 RCL "LAT2"
11 COS
12 ×
13 RCL "LON1"
14 RCL- "LON2"
15 COS
16 ×
17 RCL "LAT1"
18 SIN
19 RCL "LAT2"
20 SIN
21 ×
22 +
24 360
25 ÷
26 40076
27 ×
28 RCL- "DIST"
29 .END.

Edited: 18 Mar 2007, 5:07 p.m.



Try the "HP25 Applications Programs" book, pages 61-69



you could try the "Terrestrial geodesic distance" programs

in the HP-41 library.




Thanks to all. I had hoped to find the example I used before but I will be more adventurous and try one of the complex solutions. Sam


Are you referring to the programs in the Navigation Pacs for HP65 or HP67? Both of those manuals are on the DVD under the "Calculator Software Manuals" subheading.



Actually, there is a simpler routine called Great Circle Navigation in the manual for the HP65 Standard Pac. That is on the DVD too. Maybe that is the one you are remembering? It just fits into the HP65's 100 steps.



I would recommend this highly.

Jean-Marc doesn't post nearly frequently enough on the Forum for my liking. I have become a huge fan of his work--indeed, most of my more recent programming efforts in special functions for the HP33S and 32sii are basically shameless plagiarisations of his stuff. His contributions are prolific and are almost always huge improvements over what has previously been available in the HP41 users' library solution books.

Can you let us know if you ever locate the old program you were thinking of?



First my surprise at finding my own entry in this forum on Google search for Kinpo. Second the equation I used must have been in a calculator manual as I did not buy any other texts or programs.
It specifically had a correction for crossing the equator when a certain term was evaluated. I foumd that term in the equation and during the solution added a test and a flag to make the correction automatic. It must have been for the HP-65 as it fit in the program space with few steps left. Sam Thanks all.


Hi Les,
Thank you for praising my programs.
The angular distance d between (L,b) and (L',b') on a sphere
may also be obtained by

( sin(d/2) )^2 = ( sin(b-b')/2 )^2 ( cos(L-L')/2 )^2
+ ( cos(b-b')/2 )^2 ( sin(L-L')/2 )^2

where L , L' = longitudes and b , b' = latitudes

These formulas are less accurate than Andoyer's formulas,
except perhaps for nearly antipodal points.

Actually, d/2 is in X-register at line 30 of the "TGD" program
listed in "Terrestrial Geodesic Distance for the HP-41.
( delete lines 27 and 23 which are unuseful here )
and simply multiply by the Earth diameter to get the distance.


Possibly Related Threads...
Thread Author Replies Views Last Post
  15C Spotted on National Geographic Program Jeff O. 0 270 04-16-2010, 01:27 PM
Last Post: Jeff O.
  Coordinates conversion to bearing and distance rodf 1 271 07-24-2007, 12:55 PM
Last Post: Chan Tran
  HP-16C programming challenge - Hamming distance Eric Smith 9 816 01-27-2006, 12:53 AM
Last Post: Eric Smith
  bicycle distance meter tal 0 217 08-04-2002, 04:08 AM
Last Post: Tal

Forum Jump: