Calculate distances between locations and travel time estimates.
The straight-line distance between two points on Earth is the great-circle distance. It is the shortest path over the surface of a sphere, which is what aeroplanes approximate and what a road never is. A driving route between two British cities is longer because of the road network.
The usual formula is the haversine formula, using latitude and longitude in degrees. The Earth is not a perfect sphere; for a journey across the UK the error is small next to the difference between a straight line and the A-road.
Convert each latitude and longitude to radians. With R = 6,371 km (a common mean radius):
a = sin²(Δlat/2) + cos(lat1) × cos(lat2) × sin²(Δlon/2)
distance = 2 × R × arcsin(√a)
Δlat and Δlon are the differences in radians. The result is kilometres. Miles = kilometres ÷ 1.609344. This is not driving distance and it ignores hills.
Central London is about 51.5074° N, 0.1278° W. Manchester city centre is about 53.4808° N, 2.2426° W.
The haversine distance between those two points is about 262 km, which is about 163 miles. The road distance is longer; a satnav will not quote 163 miles for the drive. Use 262 km as the straight-line gap, for example to compare with a flight, not as the mileage you will put into the fuel-cost calculator.
Swap the sign of a west longitude: 0.1278° W is −0.1278 in the formula if east is positive. Getting the sign wrong on a UK trip throws the point into the wrong hemisphere and the distance becomes nonsense.
Because those follow roads. This follows the curve of the Earth. For fuel and time, use the road distance from a maps app, then the fuel-cost page. For “how far apart are these two grid references as the crow flies”, use this.
6,371 km is the mean radius used in most classroom and mapping approximations. A more detailed ellipsoid changes a UK distance by a fraction of a percent. It will not turn 262 km into the road distance.
Only once you have looked up a latitude and longitude for each postcode. A postcode covers an area, not a door. For a town-to-town sketch that is fine. For a legal boundary it is not.
Yes. Over a few kilometres it agrees with a flat Pythagoras sum on a local grid, if you convert degrees carefully. Over a back garden, a tape measure is better than GPS coordinates from a phone.