Calculating distances using Latitude and Longitude

L

Larry

Can somebody help me on how to calculate the distance
between two cities using Lat. and Long. but I am having
problem using it in Microsoft Access 2000. The ARCOS or
ACOS(ArcCosine)function is not recognizing by Microsoft
Access. I have the formula, but "ACOS" function is not a
built in function in Access.

If you can tell me what to do with this, I would really
apprecite it.

Thank you in advance,
Larry
 
M

Mike Painter

Larry said:
Can somebody help me on how to calculate the distance
between two cities using Lat. and Long. but I am having
problem using it in Microsoft Access 2000. The ARCOS or
ACOS(ArcCosine)function is not recognizing by Microsoft
Access. I have the formula, but "ACOS" function is not a
built in function in Access.
http://www.freevbcode.com/ShowCode.Asp?ID=5532
has one.

http://www.movable-type.co.uk/scripts/LatLong.html

Haversine formula: R = earth's radius (mean radius = 6,371km)
?lat = lat2 ? lat1
?long = long2 ? long1
a = sin(?lat/2)² + cos(lat1).cos(lat2).sin(?long/2)²
c = 2.atan2(?a, ?(1?a))
d = R.c

Somewhere I have an even simpler one but I can't find it now (or even
remember where I saaw it.)
 
V

Van T. Dinh

Check Access VB Help topic "Derived Mathematical
functions".

Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)

HTH
Van T. Dinh
MVP (Access)
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top