Back Home

Q: Given two points on the globe, how do you figure out the direction and distance to each other?

By Posted On

Posted in Insane

Physicist: The very short answer is: use the spherical law of cosines so you can do trigonometry on a sphere.

This is a seriously old problem that needed to be solved before we became a routinely globe-trotting species. If you have the latitude and longitude of your location and a destination, you could just move east/west until you match the destination’s longitude then move north/south until you match the latitude. But that’s a big waste of time, as the so-intuitively-obvious-it-barely-deserves-a-name “triangle inequality” will tell you.

As you may have heard, the shortest distance between two points is a straight line. For curved surfaces the closest you can get to a straight line is a “geodesic”, which is a straight line on small scales, but it you step back may be going all over the place. If you wrap a ribbon around a gift (or any manner of festive package) and manage to keep it flat, you’ve found a geodesic, because if the path of the ribbon changes direction, the ribbon kinks. On a sphere like Earth, where you’re stuck moving along the surface (instead of drilling straight through like some kind of compulsive, fire-proof mole), the geodesics are “great circles”. If you walk in a straight line, you’re walking on a great circle.

Doing geometry on a sphere is more difficult than geometry on a flat plane, but not by a hell of a lot. Geometry, despite what some pudunk Greek philosophers may say, is basically just playing with triangles. A nice, universal rule for any triangle is the Law of Cosines which relates the lengths of the three sides, a, b, and c, with the angle opposite one of those sides, C: .

Slap that triangle on the side of a sphere and that law becomes the Spherical Law of Cosines:

Here the meaning of a, b, and c has changed a little. Lengths on a sphere can be described by angles (drawn from the center to the surface). If you’re using radians (which you always should), those angles are . This is generally easier to use than the actual distance. For example, the angle from the north pole to the equator is 90° (obviously) while the physical distance is about 6,200 miles (different on every planet).

Lucky for us, positions on Earth are usually described in terms of angles (latitude and longitude) and not distances, so the spherical law of cosines is ready to go. Just put the corners at the north pole, where you’re at, and where you’re planning to go.

The law of cosines (either of them) relates four things: all three sides and one of the angles. If you have any three of those pieces of information you can solve for the forth. With the latitudes we have two sides and with the difference of the longitudes we got an angle.

First (because you always should) convert your angles from degrees to radians by multiplying by : , , and .

and therefore

Boom! There’s the distance. And with three sides in hand (the two given by the latitudes and the distance from, like, two seconds ago) you can find your “bearing”, the angle between north and your destination.

and so

For example, if you happen to be traveling from Nueva Guinea, Nicaragua (11.6932° N, 84.4540° W) to Nesflaten, Norway (59.6466° N, 6.7997° E), the angles involved are , , and . So the distance is

and the bearing is

If you want to walk in a straight line from downtown Nueva Guinea to uptown Nesflaten, you’d face due north, turn about 30 degrees to the right, and walk in a straight line for about two and a half months, while ignoring the Atlantic Ocean to the best of your ability.

So how do you calculate distance and bearing? A small bucket of math. Today if you want to calculate sines and cosines you break out a computer. So you may be wondering how they did this math back in the days of sailing ships (without GPS). They didn’t. Calculating was done once, then written down, then looked up many times. Once upon a time books were useful!

The people who actually did the calculating were “computers”; pitiable folk who sat in dark rooms and slowly went mad and rarely got to sail around the world.