Hacker News new | past | comments | ask | show | jobs | submit login
100 years to solve an integral: The history of the Mercator map (liorsinai.github.io)
77 points by the_origami_fox on Aug 28, 2020 | hide | past | favorite | 40 comments

> In 1614, John Napier introduced logarithms.

> Napier’s main motivation was to find an easier way to do multiplication and division.

> Next, mathematicians decided to combine these tables. If you wanted to multiply trigonometric functions, you could find the values in a trigonometric table and then convert them to logarithms.

Actually, Napier's 1614 Mirifici Logarithmorum Canonis Descriptio contains tables of −10⁷ ln(sin x/10⁷) [0]. Non-trigonometric log tables appeared later.

[0] https://jscholarship.library.jhu.edu/bitstream/handle/1774.2...

Yes you're right. It has to do with how he derived the approximation formula for the natural logarithm. He needed a function y=sin(x) for his log(y) calculations. But I am not sure when the log(f(x))) tables for the other trigonometric functions came about. As far I understood, initially a single log(y) table sufficed.

Well, I suppose Napier presaged the concept of a single source of truth. Aren't other log-trig tables a waste of paper if you can look up log(cos x) under log(sin(90°−x)) and quickly calculate log(tan x) as log(sin x)−log(cos x)?

I did a course on cartography a couple of years ago, and one of the better assignments was to find a suitable projection and make a proper map describing a comparison in distances between two points. The projection I used was of course Two-Point Equidistant Projection (the only possible one).

My resulting map is on the last page here: https://adelie.antarkt.is/aron/l0020b.pdf

EDIT: Apparently it was one of my GIS courses, not the cartographic one, which were more color theory and labels.

One bad thing about the projection is that great circles are curved, so my straight lines should have been curved as well.

LLA: the optimal hub — at least in summer. (and modulo transpacific routes?)

I remember there was much talk in the local press around 25 years ago about how Kallax/LLA was to be the next big freight hub. It went as far as extending the runway to accommodate bigger planes (making it the longest runway in Sweden, if Wikipedia is to be believed). As far as I know, the freight boom failed to materialize, largely because Russia were not very keen on allowing flights through their airspace.

So we need a map projection that weighs distances by political resistance. :)

The LLA freight proposal was given by the teacher in the assignment, but I guess there is a real benefit. Isn't Anchorage preferred over Honolulu for most trans-pacific flights?

Yes, Anchorage is a major freight hub. Apparently, fourth busiest in the world: https://en.m.wikipedia.org/wiki/Ted_Stevens_Anchorage_Intern...

Hej. Sorry, I have no idea.

https://www.flightradar24.com/ makes it look like most flights are direct (too far south for ANC, too far north for HNL), but I couldn't quickly find any way to filter out cargo from pax.

PS. Having just seen https://www.youtube.com/watch?v=5hdUKZLQIuQ I have to ask if you all really chew snus? What savages — tobacco is for schnupfen. https://www.youtube.com/watch?v=oOa1cz7O3kU

Haha, if you drive EPA you most definitely use snuff, in the mouth.

BTW, is there still no online map that would use some better projection (i.e. anything but [Web-]Mercator)? I mean, there is Google Earth, of course, but it has too much visual effects added, to use it as a go-to tool, as I use OSM or Google Maps. But mercator makes large scale distance and area comparison absolutely unintelligible, and I would rather much prefer to be able to use Kavrayskiy VII/Natural Earth or something like that with OSM. No way it could be too computationally expensive in 2020, right? (I mean, once again, we do have Google Earth.)

I don't think there is an area-preserving projection that can work for all the scales online map services are designed for.

If you are creating your own global-extent map at a limited range of scales, most of the OSM tooling for example PostGIS lets you specify a custom projection like http://shadedrelief.com/ee_proj/

If I'm creating my own map I can kinda draw whatever the fuck I want. I need a web-map (preferably OSM-based) that I can use as a web-map, but with a projection less fucked up than Mercator, of which I can name at least 10 in addition to 2 I already named. Also, web-mercator generally is not a problem on small scales, so there isn't really a problem of alternating between projections depending on scale. (Which is not really necessary too, since other projections are generally more or less ok even on small scale. You can totally use globe view on google maps on city-scale and barely notice any difference at all.)

Perhaps it was unintentional but the tone of your comment comes across as over the top hostile in response to someone who was just trying to help you.

Esri's ArcGIS Online supports over 100 projections, and they're always working on more.

I had the privilege of chatting with one of the developers there who works on their projection engine (which is unmatched in the industry, as far as I know). To contribute to it, one effectively has to be at the graduate level in mathematics, low-level programming (especially numerical methods), and geography at the same time.

I did a project where we produced maps of car dealerships. We clustered close together dealerships. The distance function that I used for measuring "closeness" evolved from a simple Euclidean distance (sqrt(∆x²+∆y²)) to one that used box-shaped neighborhoods (max(∆x,∆y)) to a variation on this last one that took Mercator distortions into account because Alaska. This was one of the most fun projects I worked on.

There was one subtle bug that I had in the web interface where at the US level, clicking on the wrong place in the spash screen loaded, instead of the clustered dealerships at that level, instead added a pin to the map for every single dealership in the country. It took about 10 minutes to render on 2007 hardware but was really pretty when it was done. I no longer have the screenshot unfortunately.

If you are looking for directions in a city, what matters most to you is that the roads look correct. This is why the Mercator map is used.

Whoa, wait a second...is this saying that roads which look straight on a map are actually not straight, in the sense that they're not actually following the shortest path between two points?

It's slightly appalling to me to think that people all over the world are building crooked roads so that they appear straight on a Mercator map, and then using Mercator maps so that existing roads continue to look straight.

I guess it probably doesn't make much difference on a local level, where the distances are relatively short, but there's still something a little bit horrifying about it, if I'm understanding all of this correctly.

Any physical infrastructure, such as roads, is going to be distorted by local topography, which furthermore may not be entirely consistent from year to year (land can creep forward or hillsides erode somewhat). This deviation will tend to enormously outweigh the errors caused by map projection.

Another note is that legal boundaries tend to be defined on the basis of actual surveyed boundary markers, not on the logical definition of the line. So the US-Canada border, while originally defined as exactly 49°N, the actual border is actually generally about a few hundred feet south of that line. These surveys were generally conducted by people running literal chains in a constant bearing for some distance (maybe several hundred yards at most) and then taking another reading of their position to correct the line. Of note is the Mason-Dixon Line, which was precise enough to note that the errors in their surveying had a systematic error to them--which was realized to be the physical mass of the Appalachian Mountains ever-so-slightly deviating plumb lines from vertical.

Also note that historical boundaries were more often specified as "reference point and bearing" (or along line meridians/parallels, which amounts to the same thing) then "from point A to point B". In this regard, the straight line on a Mercator map is more accurate than the geodesic shortest-distance-between-two-points.

Then there's the history of the Tennessee-Kentucky border (and that weird jog in the otherwise straight line). https://www.tngenweb.org/campbell/hist-bogan/surveyor.html

You know that bump in Minnesota where it goes up into Canada? It was a map making fuck up:


The most important thing for a map at the local level is that it be conformal - that is, shape-preserving.

If the angle between two roads is 38 degrees, the angle should be 38 degrees on your map. Mercator is conformal.

Area distortions aren't a big deal, because on a local level, they only have the effect of scaling the map by an overall factor. You have to zoom in more to see features of a given size at the equator than at high latitudes, but that's not such a big problem.

Another nice feature of Mercator is that it's cylindrical, so when you zoom out, the map fits on a rectangular screen.

Many countries (I know for certain Sweden, Norway and the US) use Transversal Mercator for local maps. The UTM zoning system makes the error as small as possible in the local area.

Some use a local Lambert conformal conic projection.

Interesting! I guess it is preferable for countries stretching in the east-west direction, instead of north-south?

Every US state consists of one or more zones that use specific map projections for best representation. The choice goes significantly further than just the choice of projection family.

You can find resources for the State Plane Coordinate System online.[1]

For example, the transverse Mercator projection intuitively maps from a sphere onto a cylinder oriented east-west (rather than pole to pole). But since we can vary the relative position of the sphere (such as which longitude is closest to the line perpendicular to the surface of the cylinder), we actually define a family of projections.

Another variable is the model of the Earth's surface used for the mapping. For example, the web Mercator projection maps from an ideal sphere, but that is not sufficient for many more precise applications. See geoid[2] and datum.[3]

Geodesy and geomatics are pretty huge areas of applied science that go far beyond the scope of a blog post.

[1] https://www.edc.uri.edu/nrs/classes/NRS409509/Lectures/4MapB...

[2] https://en.wikipedia.org/wiki/Geoid

[3] https://en.wikipedia.org/wiki/Geodetic_datum

>Whoa, wait a second...is this saying that roads which look straight on a map are actually not straight, in the sense that they're not actually following the shortest path between two points?

The Gaussian curvature of Earth is small enough that for distances below 50 miles and locations south of the Arctic Circle, it really doesn't matter.

But the nice thing about the Mercator map is that it shows a constant bearing (Δlat/Δlong) as a straight line. The only projection which shows great circles as straight lines is the gnomonic projection, but this is limited to showing a very small region before distortion becomes unacceptable.

I believe some highways are purposely built slightly crooked (like an S) over long flat stretches, to keep drivers more engaged and less likely to fall asleep. I'm not sure if there are any that are built that way to look straight on Mercator projection.

Of course, there are large parts of the world where the population density isn't worth doing such a thing, and you have quite long roads that are perfectly straight from the driver's point of view.


It's an interesting question but the precise straighteness of roads would more likely be derived from local ground surveying (e.g., optical) which places the markers from which construction commences.

The maps then eventually record what was actually built (measured by satellite nowadays).

This is not what I meant XD You want roads in real life that are straight to look straight on a map. Actually, most global map projections do not meet this simple requirement. For an extreme case, think of how compressed everything is at the top of Lambert's map.

Very long roads are not truly straight because they follow the curvature of the earth, but I was not referring to those. In any case, you're more likely to notice winding around local topology and local elevation changes on long road trips.

Also see roywiggins answer :)

Mercator preserves compass angles. So a road that goes northwest/southeast will always run at a 45 degree angle to horizontal. This preserves the appearance of city grids, and means that if the intersection is as a particular angle, it will look like it on the map.

Otherwise, you will end up with 90-degree intersections that look squished, which is unhelpful.

Aren't there distortions the further north/south you go? At the limit, a 90 degree angle with the corner at the pole would map to a half box shape. I'm having problem visualizing what happens right before the limit though.

There are increasing scale distortions as you go farther from the equator, but angles (and thus shapes) are always conserved.

Tissot's indicatrix is a way of visualizing both scale and shape distortions on maps. It shows how equal-radius circles drawn on the Earth are distorted by a given map projection. This is what it looks like for the Mercator projection: [1]. This is what it looks like for a map projection that does not preserve angles (shapes): [2]. The latter projection would produce very misleading road maps far away from the equator. Intersections would get squished in the North-South direction, so the angles between roads would be wrong.

1. https://en.wikipedia.org/wiki/Tissot%27s_indicatrix#/media/F...

2. https://en.wikipedia.org/wiki/Tissot%27s_indicatrix#/media/F...

The angle preservation does break eventually, right at the poles. But it's an abrupt break, it goes from "perfectly preserved" in the region around the poles to "totally broken" at the poles.

The author tells the story of typical undergraduate instruction for the integrals of tan(x) and sec(x). I would have thought that such a setting would have included that these were improper integrals, because of the infinities in the functions. i.e. if you evaluate the definite integral for any particular interval, it will give you the right answer except if you've gone through the part where the graph goes up to plus infinity and back through minus infinity.

Can someone more mathematically literate than me shed any light on whether it matters? I guess it's still useful even if the integral is undefined at certain points off the edges of the map.

It matters here in the sense that to show the poles, you need to stretch the Mercator map to infinity, because the function sec(x) is undefined at 90 degrees. This is clearly absurd, so map makers get around the problem by cutting the top of the map off, usually around the 85 degrees parallel. I chose not to include this detail in the article.

To slightly misquote the great Richard Feynman, "It turns out that it's possible to sweep the infinities under the rug by a certain crude skill." :)

Buckminster Fuller invented a map projection called the Dymaxion [1], imagine peeling an orange peel as one intact piece and placing the North pole at the very center.

1 https://en.wikipedia.org/wiki/Dymaxion_map

The irregular shape of Dymaxion always bothered me. I much prefer the Cahill–Keyes projection: https://en.wikipedia.org/wiki/Cahill%E2%80%93Keyes_projectio...

In modern shipping is this used or do ships just follow the shortest distance between points? Perhaps GPS has made that simple?

Even back "in the day" the routes weren't actually following those lines. Here's a neat animation of the routes many ships took (from their logbooks) starting in the 1750's:


Applications are open for YC Summer 2023

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact