Skip to contentSkip to conversation

Distance measuring

DISCUSSION Phil 6 participants 6 messages Jan 6, 2004 – Jan 7, 2004

lore
Share & tools
lore

Phil

author
#0 lore raw

Hello Everyone,

I'm looking for a Linux application, or maybe the code that does the calculation, that will measure the distance between two points given the latitude and longitude. I've seen applications that measure the distance between grid squares but that's not what I need.

Can anyone help?

Signature · 2 lines
Regards,
Phil.
#1 lore raw
Quoted 19 lines · On 2004.01.06 02:52:01 +0100 Phil wrote:

Hello Everyone,

I'm looking for a Linux application, or maybe the code that does the calculation, that will measure the distance between two points given the latitude and longitude. I've seen applications that measure the distance between grid squares but that's not what I need.

Can anyone help?

Signature · 8 lines
Regards,
Phil.


-
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Substract the two latitudes and the two longitudes and use pythagoras for calculating the difference in degrees (hypot() in libm)
Then you have the distance in degrees...
If you use relativly localized positions you can asume the latitude and longitude to form a perfect square grid and simply multiply with a constant to get other measures of distance.
If you want it done proberly you have to use the right geode and assorted stuff.
Most aprs programs like xastir will also do distance calculation, maybe you can look at their code for some more scientific way :)

Jeroen

#2 lore raw
In reply to Phil
Quoted 4 lines

I'm looking for a Linux application, or maybe the code that does the calculation, that will measure the distance between two points given the latitude and longitude. I've seen applications that measure the distance between grid squares but that's not what I need.

Look at the proj.4 package. The geod and/or invgeod commands can do these calculations.

http://remotesensing.org/proj/

Dennis Boone
KB8ZQZ

#3 lore raw
In reply to Phil
Quoted 8 lines · Phil

Hello Everyone,

I'm looking for a Linux application, or maybe the code that does the calculation, that will measure the distance between two points given the latitude and longitude. I've seen applications that measure the distance between grid squares but that's not what I need.

Can anyone help?

Hi Phil.

You might also want to check out Hamlib at http://sf.net/projects/hamlib

Last summer a substantial amoutn of re-work went to locator.c in the src directory which implements just the functions you're looking for. Hamlib is written in C and it's a reasonably simple matter to install the library and use those functions in your program. I won't guarantee the code to return extremely accurate results, but they seem reasonable.

Right now the only way to get the latest changes is through CVS although a stable release is expected in the next few weeks.

HTH,

73, de Nate >>

Signature · 5 lines
 Wireless | Amateur Radio Station N0NB          |  Successfully Microsoft
 Internet | [email protected]               | free since January 1998.
 Location | Bremen, Kansas USA EM19ov           |  "Debian, the choice of
  Amateur radio exams; ham radio; Linux info @  |     a GNU generation!"
             http://www.qsl.net/n0nb/           |   http://www.debian.org
#4 lore raw
In reply to Phil

Hi Phil,

if Perl would come into account, look at www.cpan.org and look at Math::Trig module, both distance and heading functions are in.

73,
Milan OK1XH

Quoted 8 lines · Phil

Hello Everyone,

I'm looking for a Linux application, or maybe the code that does the calculation, that will measure the distance between two points given the latitude and longitude. I've seen applications that measure the distance between grid squares but that's not what I need.

Can anyone help?

#5 lore raw
In reply to Phil
Quoted 6 lines · Phil

Hello Everyone,

I'm looking for a Linux application, or maybe the code that does the calculation, that will measure the distance between two points given the latitude and longitude. I've seen applications that measure the distance between grid squares but that's not what I need.

Can anyone help?

ftp://ftp.ucsd.edu/hamradio/packet/misc/gc107.tar.gz

Regards,
Joop