Re: Distance calculation
- From: "Rick Raisley" <heavymetal-A-T-bellsouth-D-O-T-net>
- Date: Wed, 3 Oct 2007 08:30:57 -0400
"Prashant Shah" <dr_prashants@xxxxxxxxxxx> wrote in message
news:uNR$o7aBIHA.324@xxxxxxxxxxxxxxxxxxxxxxx
Res.Mr.Harold Druss,
I thank you very much for quickly supplying the code for the distance
calculator. It will be of great help for me.
You wrote the function as
Public Function distance(lat1, lon1, lat2, lon2, unit) As Variant
What is the "Unit" is for?
You have given two examples in the Select case statement "K" and "N"
What are they?
Based on the values given, I would say that the unit is normally in miles,
and using a "K" as unit converts to kilometers. I would also guess that
using "N" converts to nautical miles, but assuming that's true, the
conversion is a bit off. It indicates multiplying by 0.8684, but a more
accurate value would be 0.8690 (or 0.8689762, depending on how accurate you
want to be).
FYI, the 1.1515 is a value to convert the distance to miles, based on an
average circumference of the earth (although based on standard values, I
think it should be a bit higher). As the Earth is not a true sphere, it's a
bit complex to get it exact. For more information you can check out:
http://en.wikipedia.org/wiki/Great-circle_distance
--
Regards,
Rick Raisley
.
- Follow-Ups:
- Re: Distance calculation
- From: Ralph
- Re: Distance calculation
- References:
- Distance calculation
- From: Prashant Shah
- Re: Distance calculation
- From: Harold Druss
- Re: Distance calculation
- From: Prashant Shah
- Distance calculation
- Prev by Date: Fibre2fashion Launches Unique Software Solutions Section For Textile Industry
- Next by Date: Re: Embed pdf in outlook email with visual basic
- Previous by thread: Re: Distance calculation
- Next by thread: Re: Distance calculation
- Index(es):
Relevant Pages
|