Can any body tell me how to calculate distance between two points (latitude ,longitude given)on a map.

Basically I want to know that with the difference of one degree how much will be the difference in Distance.

That is One Degree = How much Distance(of course radius).

Basically I want to know that with the difference of one degree how much will be the difference in Distance.

That is One Degree = How much Distance(of course radius).

First you need to know LT and LG of any two different locations. then you calculate the difference between the two by static methods. After that you may check the LT & LG of another city which is say 100 kms away. the change in LT & LG will be found out. The resulting figure may be used in the form of statement in automated calculations.

It is trial based method, but I am sure it will do the job. If anyone has a formula to achieve this result, s/he is most welcome.

LT & LG can now be grabbed in the web based systems also using IP address of the person. for more information see www.geoselect.com (amazingly accurate if using DialUp)

This one is on us!

(Get your first solution completely free - no credit card required)

UNLOCK SOLUTION
C = sin(Latitude1/57.3) * sin(Latitude2/57.3) +

cos(Latitude1/57.3) * cos(Latitude2/57.3) *

cos(Longitude2/57.3 - Longitude1/57.3)

Distance = 3959 * acos(C)

I have question about the last solution proposed.

The distance is in mile or Km?

Those it's take in consideration the elevation?

And, it's relevant to take care of the elevation?

Thank you.

When I try that formula with 1 degree of delta I got 69.09249563699 and not 70.

Three more questions.

Why 57.3?

Why 3959?

Do you have any web reference I can look to learn more about that very subject?

3959 Earth radius in miles

57.3 Convertion from deg to rad. (Or 180/pi)

In a attemp to get the must precise values, I check the web for more accurate values. I share it with you.

Earth radius, source ssd.jpl.nasa.gov/phys_prop

6378.136 Km

Pi values, source www.ecst.csuchico.edu/~tchung/pi_val.html

3.14159265358979

The best value I got from those number are 1 degree = 69.170713875962 Miles

That assume Earth is a perfect sphere. Maybe this is why I don't got 70? How can we say that 1 degree = 70 miles? Does my answer is more accurate?

PS I have heard of this deber expert - he is also an expert in aviation and fencing.

1. What route/road information can I get from GIS by given GPS information?

2. I hope to get the information such as route name, segment, lane, building material and etc from the GIS system.

which GIS system should I purchase?

Thanks.

Cheers

__________________________

Private Function CalculateDistance(Lat1, Lon1, Lat2, Lon2) As Double

Dim a, b, c As Double

Const PI = 3.14159265358979

Const RadiusEarth = 6371000

' 1 Degree is 69.096 miles, 1 mile is 1609.34 m

a = Cos(Lat1 * PI / 180) * Cos(Lat2 * PI / 180) * Cos(Lon1 * PI / 180) * Cos(Lon2 * PI / 180)

b = Cos(Lat1 * PI / 180) * Sin(Lon1 * PI / 180) * Cos(Lat2 * PI / 180) * Sin(Lon2 * PI / 180)

c = Sin(Lat1 * PI / 180) * Sin(Lat2 * PI / 180)

If (a + b + c) >= 1 Or (a + b + c) <= -1 Then

CalculateDistance = 0

Else

CalculateDistance = Application.WorksheetFunct

End If

End Function

Public Const gEARTH_RADIUS_METRES = 6378007

Public Const gEARTH_CIRCUM_METRES = gEARTH_RADIUS_METRES * 2 * gPI

Public Const gMETRES_PER_LAT_DEGREES = 111113.519

Public Function GetDistance(dX1 As Double, dY1 As Double, dX2 As Double, dY2 As Double) As Double

Dim dDeltaX As Double

Dim dDeltaY As Double

Dim dDeltaXMeters As Double

Dim dDeltaYMeters As Double

Dim dMetersPerDegreeLong As Double

Dim dCenterY As Double

dDeltaX = Abs(dX2 - dX1)

dDeltaY = Abs(dY2 - dY1)

dCenterY = (dY1 + dY2) / 2

dMetersPerDegreeLong = MetresPerDegreeLong(dCente

dDeltaXMeters = dDeltaX * dMetersPerDegreeLong

dDeltaYMeters = dDeltaY * gMETRES_PER_LAT_DEGREES

GetDistance = Sqr(dDeltaXMeters ^ 2 + dDeltaYMeters ^ 2)

End Function

Public Function MetresPerDegreeLong(ByVal dLat As Double)

MetresPerDegreeLong = (Cos(dLat * (gPI / 180)) * gEARTH_CIRCUM_METRES) / 360

End Function

Insert a Module

Go Alt+F11 to access the MS Visual Basic environment, at the extreme left select the Workbook you want to include the formula and Right-Click it, then insert Module and Copy and Paste the formula that I submitted before. Next step is changing the scope of the Formula replacing Private with Public and you should be able to use the formula CalculateDistance(Lat1, Lon1, Lat2,Lon2) just like any other formula in excel.

This will allow you to use the formula just in the workbook where you inserted the module. If you want this formula to be available always then you shuold convert the module to an Add-In and make sure you set the reference accordingly.

Hope this helps.

Just a comment for the formula submitted by f_rodriguez, that formula assumes that the earth is flat and is quite close to the great circular method for small distances, however once the points are about 20 km from each other, the pitagoras aproximation starts to getting off of the real value.

Best Regards

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.