FOAK: working out distances using lat & long

Discussion in 'UK Motorcycles' started by Buzby, Oct 23, 2004.

  1. Buzby

    Buzby Guest

    I'm a bit stuck here - should have been a bit more attentive at school..

    Using VB script for a web page, how do you work out the distance between two
    places, both of known longtitude and latitude.

    Basically what I want to be able to do is enter a place and find everything
    in a database say less than a mile from this one point.

    I'm sure it's easy if you know how - buggered if I do.

    TIA

    Buzby
     
    Buzby, Oct 23, 2004
    #1
    1. Advertisements

  2. I can remember finding some code to do just this about 30 years ago, and
    using it on a variety of machines from HP desktop calculators, through BBC
    Micros, to Acorn RISC machines. It was published in Radio Communication
    yonks ago, but I don't have a copy. Radio amateurs often need to work out
    Great Circle distances between two stations anywhere on the surface of the
    Earth, but normally they will be using a program written by someone else,
    rather than coding it themselves.

    If no joy, I think that an enquiry on uk.radio.amateur would bear fruit.

    Good hunting

    Rick
     
    Richard Sterry, Oct 23, 2004
    #2
    1. Advertisements

  3. Buzby

    Buzby Guest

    Thanks - however just managed to 'lift and adapt' something which seems
    surprisingly accurate!
     
    Buzby, Oct 23, 2004
    #3
  4. Buzby

    mb Guest

    It's called "Great Circle Navigation", probably.
     
    mb, Oct 23, 2004
    #4
  5. Buzby

    Nigel Eaton Guest

    Using the patented Mavis Beacon "Hunt&Peck" Technique, mb
    It is, but for small distances a rhumb line works pretty well. For a
    mile, it'd be more than accurate enough.
    --
    Nigel - Manufacturer of the "Champion-105" range of rearsets

    WS* GHPOTHUF#24 APOSTLE#14 DLC#1 COFF#20 BOTAFOT#150 HYPO#0(KoTL) IbW#41
    ZZR1100, Enfield 500 Curry House Racer "The Basmati Rice Burner",
    Honda GL1000K2 (On its hols) Kawasaki ZN1300 Voyager "Oh, Oh, It's so big"
     
    Nigel Eaton, Oct 23, 2004
    #5
  6. Buzby

    Eiron Guest

    Not needed for distances of a mile or so.
    For the distance between two points:

    Take the difference in latitude in degrees, multiply by 10000 and
    divide by 90 to get it in kilometres.

    Do the same for longitude but multiply by the cosine of the latitude.

    Take the square root of the sum of the squares of the above two values
    and Bob's your uncle.
     
    Eiron, Oct 23, 2004
    #6
  7. Buzby

    Nigel Eaton Guest

    Using the patented Mavis Beacon "Hunt&Peck" Technique, Champ
    **** me! AFAIC, it's just a straight line on a chart.

    Having looked at that webpage, I'll never go to sea again.

    --
    Nigel - Manufacturer of the "Champion-105" range of rearsets

    WS* GHPOTHUF#24 APOSTLE#14 DLC#1 COFF#20 BOTAFOT#150 HYPO#0(KoTL) IbW#41
    ZZR1100, Enfield 500 Curry House Racer "The Basmati Rice Burner",
    Honda GL1000K2 (On its hols) Kawasaki ZN1300 Voyager "Oh, Oh, It's so big"
     
    Nigel Eaton, Oct 23, 2004
    #7
  8. It was somewhere around Barstow, on the edge of the desert, when the
    Eek!

    --

    Dave

    GS 850 x2 / SE 6a
    SbS#6 DIAABTCOD#16 APOSTLE#6 FUB#3
    FUB KotL OSOS#12? UKRMMA#19 COSOC#10
     
    Grimly Curmudgeon, Oct 23, 2004
    #8
  9. Buzby

    Buzby Guest

    Perfect. Thanks very much.
     
    Buzby, Oct 24, 2004
    #9
  10. Buzby

    Ace Guest

    I had to study (nautical) navigation when I was about 17, but I don't
    think we ever approached it in that way. Instead we based it all on
    3-d trigonometry, using cosh, shin and than h for hyperbolic, IIRC).

    Piece of piss in practice, as they work for a shape (line, engle,
    whatever) on a sphere's surface in exactly the same way as their
    normal cousins on a flat surface.
     
    Ace, Oct 25, 2004
    #10
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.