Determining distance between two coordinates

Home Forums Hiding and Hunting Puzzle Caches Determining distance between two coordinates

This topic contains 9 replies, has 6 voices, and was last updated by  Team Black-Cat 15 years, 10 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1729241

    Todd300
    Participant


    How do I determine the distance between two sets of coordinates by using math, not a GPS? Doing this will help me on the way to solve a puzzle. Thanks 🙂

    #1917980

    hogrod
    Member


    You can use the program FizzyCalc (free) to do this for you. once you have the program I believe what you are looking for is under the distance tab.

    http://www.fizzymagic.net/Geocaching/FizzyCalc/

    #1917981

    Team Deejay
    Participant


    If you are working on the puzzle that I think you are working on, pay close attention to the description and hints. Some people’s view of the world is skewed, similar to that of people in the 12th century. I wonder if they were worried about sailing off the edge of the world!

    #1917982

    Team Black-Cat
    Participant


    Unless you REALLY need to do the math, you should probably find an online utility to get the distance.

    But since you asked…
    I recently created a function for a program I’m working on. Here’s what I did.
    Keep in mind that I am a programmer and not a mathmatician…

    Start with decimal degrees instead of degrees and minutes. You can do the conversion on GC.com.

    Convert each coordinate to radians:

    A=(Point1Latitude * Pi /180)
    B=(Point1Longitude * Pi /180)
    C=(Point2Latitude * Pi /180)
    D=(Point2Latitude * Pi /180)

    Get the difference between the angles:

    DLat=C-A
    DLon=D-B

    Now it gets fun…

    X = Sin(DLat / 2) * Sin(DLat / 2) + Cos(A) * Cos(C) * Sin(DLon / 2) * Sin(DLon / 2)
    Y = 2 * Atan2(Sqrt(X), Sqrt(1 - X))

    To get miles, multiply Y by 3959.

    Did I get it right Mathman?

    Edited to add:
    Atan2 might not be on your calculator. It is the angle whose tanget is the quotent of the two specified numbers.

    #1917983

    CodeJunkie
    Participant


    @Team Black-Cat wrote:

    A=(Point1Latitude * Pi /180)
    B=(Point1Longitude * Pi /180)
    C=(Point2Latitude * Pi /180)
    D=(Point2Latitude * Pi /180)

    I assume you meant Point2Longitude for D.

    #1917984

    Team Black-Cat
    Participant


    Yes I did, and thanks for catching that. I can’t edit the original post anymore…

    #1917985

    Team Black-Cat
    Participant


    #1917986

    Miata
    Participant


    @Team Black-Cat wrote:

    The hard way
    The easy way

    Much better……

    #1917987

    CodeJunkie
    Participant


    For a whole bunch of different versions of this, do a “Google” search using the following words:
    gps distance calculator

    #1917988

    Team Black-Cat
    Participant


    @codejunkie wrote:

    For a whole bunch of different versions of this, do a “Google” search using the following words:
    gps distance calculator

    If you’re having trouble sleeping, search for “haversine”.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

Purveyors of Fine Tupperware