+ Reply to Thread
Results 1 to 3 of 3

Distance between two sets of coordinates.

  1. #1
    Marcus Fox
    Guest

    Distance between two sets of coordinates.

    I am looking into writing a spreadsheet that will calculate the shortest
    distance over the Earth's surface between two (or a table containing a
    number of) cities. These cities will be referenced by their latitude and
    longtitude coordinates in the format dd mm ss.sss.

    The closest formula I have been able to find is the Haversine formula. d =
    R.c

    R = mean radius of the earth (6,371 km)

    d(lat) = lat2 - lat1
    d(long) = long2 - long1
    a = sin^2(d(lat)/2) + cos(lat1).cos(lat2)sin^2(d(long)/2)
    c = 2 arcsin(sqrt(a)

    Assuming lat1 is in A1, long1 is in B1 and lat2 is in A2, long2 is in B2
    would something like

    =6371*(2arcsin(sqrt(sin^2(A2-A1)+cos(A1)*cos(A2)sin^2(B2-B1)/2))

    be acceptable? How do I proceed further?

    Marcus




  2. #2
    Tom Ogilvy
    Guest

    Re: Distance between two sets of coordinates.

    Check out Chip Pearson's site:

    http://www.cpearson.com/excel/latlong.htm

    --
    Regards,
    Tom Ogilvy

    "Marcus Fox" <[email protected]> wrote in
    message news:[email protected]...
    > I am looking into writing a spreadsheet that will calculate the shortest
    > distance over the Earth's surface between two (or a table containing a
    > number of) cities. These cities will be referenced by their latitude and
    > longtitude coordinates in the format dd mm ss.sss.
    >
    > The closest formula I have been able to find is the Haversine formula. d =
    > R.c
    >
    > R = mean radius of the earth (6,371 km)
    >
    > d(lat) = lat2 - lat1
    > d(long) = long2 - long1
    > a = sin^2(d(lat)/2) + cos(lat1).cos(lat2)sin^2(d(long)/2)
    > c = 2 arcsin(sqrt(a)
    >
    > Assuming lat1 is in A1, long1 is in B1 and lat2 is in A2, long2 is in B2
    > would something like
    >
    > =6371*(2arcsin(sqrt(sin^2(A2-A1)+cos(A1)*cos(A2)sin^2(B2-B1)/2))
    >
    > be acceptable? How do I proceed further?
    >
    > Marcus
    >
    >
    >




  3. #3

    Re: Distance between two sets of coordinates.

    I cannot understand your formula as the parenthesis doesn't match

    This should work
    6371*(2*ASIN(SQRT(SIN(A2-A1)^2))+COS(A1)*COS(A2)*SIN(B2-B1)/2^2)
    Else,you could use the following excel functions
    sin = SIN
    cos = COS
    arcsin = ASIN
    sqrt=SQRT


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1