Jump to content

Question of distance...


NetDep

Recommended Posts

I was curious, and nearly certain, that someone here could answer a question about determining distance between two coords. If I had been at S 34 54.952/W 055 02.791 and wanted to go to S 34 51.356/W 056 01.435 what would the distance be?

 

I can not find the usual resources beause the two coords are in Uruguay, S. America. The first is a virtual that I was at a little while ago and the second is the only cache located in Uruguay (but located in/near Montevideo where I may be returning) so I would like a rough distance. If I return and the cache is still placed I would like to try to find it.

 

Thanks in advance for anyone's help. I have previously asked a rather odd question and got help right away. By the way - I would not ask if the answer was *clearly* obvious - I try to solve those myself before posting. Take care & HAPPY CACHING!! icon_razz.gif

 

Does the walker choose the path, or the path, the walker? - Sabriel, by Garth Nix

Link to comment

Thanks for the flashback. It's been a long time since spherical trig. I had to search this one.

 

D = 1.852 * 60 * ARCOS ( SIN(L1) * SIN(L2) + COS(L1) * COS(L2) * COS(DG))

 

L1 = latitude at the first point (degrees)

L2 = latitude at the second point (degrees)

G1 = longitude at the first point (degrees)

G2 = longitude at the second point (degrees)

DG = longitude of the second point minus longitude of the first point (degrees)

DL = latitude of the second point minus latitude of the first point (degrees)

D = computed distance (km)

 

Definitions

South latitudes are negative

East longitudes are positive

Great circle distance is the shortest distance between two points on a sphere. This coincides with the circumference of a circle which passes through both points and the centre of the sphere.

Geodesic distance is the shortest distance between two points on a spheroid.

Normal section distance is formed by a plane on a spheroid containing a point at one end of the line and the normal of the point at the other end. For all practical purposes, the difference between a normal section and a geodesic distance is insignificant.

Note: If your calculator returns the ARCOS result as radians you will have to convert the radians to degrees before multiplying by 60 and 1.852 degrees = (radians/PI)*180, where PI=3.141592654...

 

Mickey

Max Entropy

More than just a name, a lifestyle.

Link to comment

quote:
Originally posted by MaxEntropy:

 

D = 1.852 * 60 * ARCOS ( SIN(L1) * SIN(L2) + COS(L1) * COS(L2) * COS(DG))

 


 

Cool! I've been thinking of adding a function in my Access database where I track my finds to calculate the total distance traveled between caches. Now I don't have to search the forum archives to find the last time someone gave the formula!

 

Thanks!

 

Anyone have a formula to determine the bearing from waypoint A to waypoint B?

 

ntga_button.gifweb-lingbutton.gif

Link to comment

Thank you all very much. I was curious and now I know. I knew I could count on the forums to get an answer - and an especially helpful website to compute this kind of thing in the future!! Thanks again & HAPPY CACHING!! icon_biggrin.gif

 

Does the walker choose the path, or the path, the walker? - Sabriel, by Garth Nix

Link to comment

ARCOS doesn't work in Access.

 

Try these fields in Access.

 

Lat1=Decimal Degrees Latitude Point 1

Lon1=Decimal Degrees Longitude Point 1

Lat2=Decimal Degrees Latitude Point 2

Lon2=Decimal Degrees Longitude Point 2

Pi: 3.14159265359

DistanceInMiles: (Atn(-(Cos([Lat1]*[Pi]/180)*Cos([Lat2]*[Pi]/180)*Cos(([Lon2]-[Lon1])*[Pi]/180)+Sin([Lat1]*[Pi]/180)*Sin([Lat2]*[Pi]/180))/Sqr(-(Cos([Lat1]*[Pi]/180)*Cos([Lat2]*[Pi]/180)*Cos(([Lon2]-[Lon1])*[Pi]/180)+Sin([Lat1]*[Pi]/180)*Sin([Lat2]*[Pi]/180))*(Cos([Lat1]*[Pi]/180)*Cos([Lat2]*[Pi]/180)*Cos(([Lon2]-[Lon1])*[Pi]/180)+Sin([Lat1]*[Pi]/180)*Sin([Lat2]*[Pi]/180))+1))+2*Atn(1))*3959

 

This is great circle calculation. It can be done with less accuracy using Pythagorean method, but that assumes a flat earth. The closer you are to the poles, the more distorted that is. Also larger distances (>500 miles) become distorted by tenths of a mile.

 

Markwell

Chicago Geocaching

Link to comment

Yeow! Waaay over-complicated. Here's what I use in VB. Esentially the same, but a little easier to follow:

 

DISTANCE = R * ARCCOS((SIN(RAD(LAT1)) * SIN(RAD(LAT2)) +

(COS(RAD(LAT1)) * COS(RAD(LAT2)) * COS(LON2 -LON1)))

 

LAT1, LON1, LAT2, LON2 are the latitide and longitude, in decimal degrees format.

 

Multiply the results by 3956.665 for miles, or 6367.52645 for kilometeres. The is the simple calculation, using an average of the polar and equatorial distances.

 

The following functions need to be implemented:

 

Private Function ArcCos(X As Double) As Double

 On Error Resume Next

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

End Function

 

Private Function Rad(X As Double) As Double

 Rad = X / 45 * Atn(1)

End Function

 

You'll notice that the value for Pi doesn't appear to be in the equation anywhere. It's actually incorporated into the RAD function. Since a Radian = X / 180 * Pi, and Pi = 4 * Atn(1), then you can resolve it down to Radian = X / 45 * Atn(1)

 

 

3608_1400.gif

 

[This message was edited by Prime Suspect on January 06, 2003 at 03:13 PM.]

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...