# Approx distance between any 2 longitudes at a given latitude

Given a SINGLE longitude coordinate in decimal degrees, how do I calculate the distance in miles or km between latitude 0 and 1 at that longitude? ie what is the formula?

For example, given 51.43567 longitude, what is the distance between 0 latitude and 1 latitude at that longitude?

Note, that I do not want any radius around the point. Just a single number in miles or km.

EDIT: I posed the wrong question above. The correct one is below. I recognise the mkenndy's answer still points to the correct formula in one way or another, however, I need the point in bold below clearly set out.

Given a SINGLE latitude coordinate in decimal degrees, how do I calculate the distance in miles or km between any longitude at that latitude? ie what is the formula?

For example, without any concept of distance *, given 51.43567 latitude, what is the distance between 1 and 2 longitiude at that latitude?

.* known distances between longitude decimal degrees are only the equator and the poles.

The answer should just be a single number in miles or km.

Marc's answer and its linked answers assume the earth is a sphere. Simplified equations for a sphere are:

``````Length of a radian of latitude = R
Length of a radian of longitude = R * cos (lat)
``````

where R = radius of earth model, lat = latitude is in radians.

The equations on an ellipsoid are:

``````Length of a radian of latitude = a*(1.0 - e*e) / (1.0 - e*e*sin(lat)*sin(lat))**(3/2)

a = semimajor axis (use the unit that you want the answer in)
b = semiminor axis
e = sqrt(2*f - f*f) = (a*a - b*b)/(a*a)
f = flattening
** = raised to the power of

Length of a radian of longitude = a*cos(lat) / (1.0 - e*e*sin(lat)*sin(lat))**(1/2)
``````

Note: If you want the answer in miles or any other linear unit, define the a (and b if used) values in the same unit OR convert after the calculation. Default is usually to use 6378137.0 meters for 'a' which would give a length in meters.

The equations as given return the length of a radian of longitude or latitude, respectively. To get the length of a degree instead, multiple each equation by:

``````PI/180.0
``````

As a check, the approximate length of a degree of longitude at the equator is 111 km as is the length of a degree of latitude everywhere (varies from about 110.5 to 111.7). The length of a degree of longitude will shorten as the latitude increases. At 45 N or S, the length is under 80 km, for instance.

See John P. Snyder's Map Projections: A Working Manual (PDF), PDF pages 36-37 or actual document pages 24-25.

• Guilty of overthinking the problem! – Marc Pfister Aug 10 '17 at 19:17
• Thx. Are you able to use my example with your formula to give the answer in miles, including working out? – dewd Aug 10 '17 at 23:07
• Defining the a and b values in miles will give an output in miles of a radian or latitude or longitude. To get the linear equivalent of a degree, add *(PI/180) to the equations. – mkennedy Aug 10 '17 at 23:11
• @mkennedy Please see my amended question. Apologies that I'm not a trig or algebra man, so as simplified an answer you can give, I'd appreciate it. I'm a stackoverflow veteran so I'm a bit like a fish out of water here. – dewd Aug 11 '17 at 18:39
• I've added more more info and incorporated the comments, but you need to help with what you're having problems with. If you put together your own code, but the answers don't look right, post the code and what you're getting and we can check it. – mkennedy Aug 11 '17 at 18:52

To convert a given latitude into the approximate distance in miles between 1 longitude at that point:

`(90 - Decimal degrees) * Pi / 180 * 69.172`

Note: if the answer is a minus number, multiply it by -1

In the example given the calculation is as follows:

`(90 - 51.43567) * 3.1415927 / 180 * 69.172` with the answer being `~47 miles`.

I think the Haversine formula would work, just set the two longitude variables to the same value.

Here's another SE discussion of the formula in Javascript.

You could also use the Law of Cosines.

Taken from: Navigation by a.c. gardner example: at Lat 50 degrees 10deg Long w to 20 deg Long w = 600 miles cosine 50 degrees-.6428 x 600 = 385 nautical miles.