Re: Distance measuring

From: Jeroen Vreeken (kblhede@mailit.tunk.net)
Date: Wed Jan 07 2004 - 02:40:14 EET

  • Next message: Dennis Boone: "Re: Distance measuring"

    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?
    >
    > --
    > Regards,
    > Phil.
    >
    >
    > -
    > To unsubscribe from this list: send the line "unsubscribe linux-hams" in
    > the body of a message to wriiy.subo@vihrealiitto.fi
    > 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

    -
    To unsubscribe from this list: send the line "unsubscribe linux-hams" in
    the body of a message to zjzx@bhak-feldkirch.snv.at
    More majordomo info at http://vger.kernel.org/majordomo-info.html



    This archive was generated by hypermail 2b30 : Wed Jan 07 2004 - 02:23:15 EET