# How to Calculate the Distance Between Two Cities

Point A
Latitude: deg min
North South
Longitude: deg min
East West
Point B
Latitude: deg min
North South
Longitude: deg min
East West
miles
nautical miles
kilometers

Have you ever wondered whether you live closer to Honolulu or Paris? Tokyo or Johannesburg? If you know the latitude and longitude of two cities, you can calculate the distance between them using a little trigonometry. This is useful if you are a world traveler searching for airports, or if you want to estimate flight times based on distance.

The first step is to figure out the latitude and longitude of the city you are in, and that of the city you are traveling to. For example, let's say you are flying from Berlin to Mexico City. Berlin's coordinates are about 52.5°N 13.4°E, and Mexico City's are about 19.4°N 99.1°W. (Note that numbers after the decimal point represent 1/10 of a degree, where as minutes represent 1/60 of a degree. 30 minutes = 0.5 degrees.)

To distinguish between North/South coordinates and East/West coordinates, you should multiply all Southern latitudes by -1, and multiply all Western longitudes by -1 as well. So this will give us the pair of coordinates (52.5, 13.4) and (19.4, -99.1). If you don't make this adjustment, it will result in inaccurate travel distances!

Now for the trigonometry. Let the variables LatX and LonX denote the coordinates of the first city, and LatY and LonY denote the coordinates of the second city. The distance between the two cities is given by the formula

24873.6 arccos[ cos(LatX)cos(LonX)cos(LatY)cos(LonY) +
cos(LatX)sin(LonX)cos(LatY)sin(LonY) + sin(LatX)sin(LatY) ].

Arccos is the inverse cosine function; the number 24873.6 is the approximate circumference of the earth in miles. Use this formula whenever you want to calculate the distance between two travel destinations, or just use the handy distance calculator above. You don't have to multiply Southern or Western coordinates by -1; it is already built into the calculator.

The maximum distance between travel destinations is 12436.8 miles, when two cities are on opposite sides of the globe. For example, if you live in Jakarta, Indonesia, then a hotel resort in Bogotá, Colombia is the farthest vacation destination for you. Some other antipodal pairs of cities are

Salto, Uruguay and Shanghai, China
Phnom Penh, Cambodia and Lima, Peru
Auckland, New Zealand and Seville, Spain
Santiago, Chile and Xian, China.