Measuring distortion

A projection between two projections

Every distortion measured on this site so far compares a map with the sphere. The operation a machine actually performs compares a map with another map — and that map has its own two principal scales, its own areal factor and its own angular deformation, none of which is the difference of the two it was built from.

Every measurement on this site so far has one thing on the left of the comparison: the sphere. A projection’s scale factor is a length on the map divided by a length on the sphere; its areal factor is an area on the map divided by an area on the sphere; its angular deformation is how far an angle on the map departs from the same angle on the sphere. That is what Tissot’s construction is for, and it is the right comparison for asking what a map does to the world.

It is not the comparison a machine ever makes. What software does, thousands of times a second, is take a coordinate that is already in one projection and put it into another. Nothing in that operation touches the sphere. A point arrives as a pair of numbers in one plane and leaves as a pair of numbers in another, and both ends are pictures.

That operation is a map — from a plane to a plane — and being a map, it has the same four quantities everything else here has.

What reprojecting from Mollweide to Mercator does, drawn on the Mollweide plane. Every dot is a point of the source picture, sized by the angular deformation the reprojection itself applies there — not the deformation of either projection against the sphere, but of the map that carries one plane to the other. It reaches 116.5° here. This is the quantity a reprojection actually costs a shape, and it is computed from the two Jacobians alone: the sphere's own metric cancels exactly, so the transformation does not depend on the shape of the Earth at all. Drawn on the source plane, in Mollweide.
Fig. 1 The angular deformation of the transformation that carries the Mollweide plane to the Mercator plane, drawn on the Mollweide plane where the file starts. This is not the deformation of either projection against the sphere; it is what the reprojection itself does to a shape, and it reaches 120° at the edges of the map.

The composite, written down

Let A be the projection the data is in and B the one it is wanted in. The transformation is BA⁻¹: undo the first map, then apply the second. Its derivative at a point follows from the chain rule, and it is a product of two matrices this site already computes for other reasons:

C=JBJA1C = J_B \cdot J_A^{-1}

with both Jacobians taken with respect to the same longitude and latitude. Everything else follows from that 2 × 2 matrix. Its two singular values are the composite’s principal scales; their product is its areal factor; the departure of their ratio from one is its angular deformation, by exactly the formula Tissot’s indicatrix uses.

There is one line in that expression worth stopping on. The metric cancels. The sphere’s own first fundamental form — the factors of cos φ and the radius that turn a derivative with respect to longitude into a scale factor on the ground — appears in JA and in JB identically, and a matrix multiplied by the inverse of another matrix carrying the same factors does not know they were there.

So a reprojection is a question about two formulae and not about the shape of the Earth at all. This is not a curiosity: it is why a library can reproject a file without being told which ellipsoid the numbers refer to, and why doing so is safe here and catastrophic one step earlier in the chain, where the datum lives and where a coordinate without its system is not a location.

What the composite does to a circle

The circle a reprojection is about to turn into an ellipse. A circle drawn on the Mollweide plane, and its image under the map that carries that plane to Mercator — normalised so each pair has the same area, because the whole map can be rescaled and the shape is what is being shown. The dashed circle is what an undistorted reprojection would leave. This is Tissot's construction with a plane in place of the sphere, and it is the right picture for a reprojection because both ends are pictures. Worst angular deformation over the sampled points: 81.2°. Drawn on the source plane, in Mollweide.
Fig. 2 A circle drawn on the Mollweide plane and its image on the Mercator plane, each pair normalised to the same area so that what is shown is shape rather than size. The dashed circle is what an undistorted reprojection would leave. This is Tissot’s construction with a plane in place of the sphere.

The picture is Tissot’s, with one substitution. A small circle in the source plane goes to an ellipse in the target plane; the ellipse’s axes are the composite’s principal scales, and its orientation is the direction the transformation stretches most.

What has changed from the usual indicatrix is the domain of the argument. An ordinary indicatrix answers what does this map do to a small circle of ground. This one answers what does this operation do to a small circle of the picture the data is already in — which is the question a cartographer has when a shape arrives looking wrong after a conversion, and the question the ordinary quantities cannot answer, because both of the maps involved may be perfectly respectable and neither one’s distortion is the one that was applied.

Two conformal projections compose to nothing

The angular deformation a reprojection applies, for six pairs. Each bar is the worst angular deformation of the map carrying one projection's plane to another's, over the sampled sphere, on a logarithmic scale from 10⁻⁷ degrees. The first two pairs are conformal at both ends and come out at the arithmetic's noise floor: a conformal map of the sphere is an analytic function of the isometric coordinate, so the composite of one with the inverse of another is analytic too, and an analytic map of the plane is a similarity at every point. Every pair with a non-conformal end deforms, and by degrees rather than by parts per million.
Fig. 3 The worst angular deformation of the reprojection between six pairs, over the sampled sphere, on a logarithmic scale from 10⁻⁷ degrees. Two conformal ends give a transformation that deforms nothing at all; every pair with a non-conformal end deforms by degrees.

Carrying Mercator’s plane onto the stereographic plane deforms nothing: the measured worst angular deformation is 1.05 × 10⁻⁹ degrees, which is the noise floor of a numerically differentiated Jacobian and not a small effect.

The reason is the one averaging two conformal projections turned on. A conformal map of the sphere is an analytic function of the isometric coordinate — that is what conformal means, once Mercator’s coordinate is in hand. The composite of one analytic function with the inverse of another is analytic, and an analytic map of the plane is, at every point, a rotation and a scaling. So a reprojection between two conformal projections is a similarity everywhere, and a similarity has nothing to report.

That has a practical edge which is rarely stated in these terms: converting between two conformal projections cannot distort a shape. Whatever a file looks wrong for after such a conversion, it is not the conversion. The check that makes this a measurement rather than a restatement is the same figure’s other bars — put a non-conformal projection at either end and the deformation is tens of degrees.

The areal factor divides, and nothing else does

Here is where the intuition a distortion table encourages goes wrong. Given that Mollweide has an areal factor of 1 everywhere and Mercator’s is sec²φ, it seems obvious that the transformation between them should have areal factor sec²φ, angular deformation equal to the difference of the two, and anisotropy equal to the ratio of the two anisotropies. One of those three is exactly right and the other two are not.

The reprojection's own areal factor, up a meridian. Two curves that lie on top of one another to 3.6e-15: the areal factor of the map carrying the Mollweide plane to the Mercator one, computed from the composite's own Jacobian, and the ratio of the two projections' areal factors against the sphere, computed separately. They agree because the determinant is multiplicative. Along the same meridian the composite's angular deformation reaches 54.1°, which no ratio of the two projections' own deformations predicts.
Fig. 4 Two curves lying on top of one another to 7 × 10⁻¹⁵: the areal factor of the transformation, computed from the composite’s own Jacobian, and the ratio of the two projections’ areal factors against the sphere, computed separately. The determinant is multiplicative, so this agreement is an identity rather than a result.

The areal factor is a determinant, and determinants multiply. |det C| = |det JB| / |det JA| exactly, and the measurement confirms it to 7 × 10⁻¹⁵ — the arithmetic’s floor. Along the meridian at 20° east the composite’s areal factor is 1.0000 at the equator, 1.3333 at 30°, 2.0000 at 45° and 4.0000 at 60°, which are sec²φ to four figures because Mollweide’s own factor is one.

Only one of the three quantities divides. For each pair, how far the composite's own quantity is from the obvious combination of the two ends'. The areal factor is a determinant and determinants multiply, so the composite's is exactly the ratio of the two — the bars sit at the arithmetic's floor. The angular deformation and the anisotropy are not: two ellipses at different orientations do not divide, and the gap is degrees and factors rather than rounding. Logarithmic from 10⁻¹⁶.
Fig. 5 For four pairs, how far the composite’s own quantity is from the obvious combination of the two ends’. The areal factors sit at the arithmetic’s floor; the angular deformations and the anisotropies do not, and the gap is degrees and factors rather than rounding.

The angular deformation does not subtract. For Mollweide to Mercator the composite reaches 120.06°, while the difference of the two projections’ own deformations, taken sample by sample, differs from it by up to 117.96°. Two ellipses do not divide. The composite’s deformation depends on the two principal directions as much as on the two pairs of scales, and a distortion table records neither direction — a point distortion has a direction makes about a single map, arriving here as an arithmetic obstruction.

The anisotropy is the interesting middle case. It divides exactly when the source projection is conformal, because then JA⁻¹ is a similarity and cannot rotate anything; the measured gap for Mercator to Mollweide is 0.00. Run the same pair the other way and the gap is 13.9. A quantity that combines correctly in one direction and not the other is a reliable sign that what is being combined is not a number but a matrix.

What replaces the subtraction, which is a pair of bounds

The intuition that fails is that the composite’s shape distortion is some combination of the two ends’. What is true instead is not an equality but a two-sided bound, and it is available in one line of matrix algebra.

Write κ for the anisotropy — the ratio of the larger principal scale to the smaller, which is the condition number of the Jacobian and which the angular deformation is a monotone function of. A condition number is submultiplicative, and the inverse of a matrix has the same condition number as the matrix, so

κBκA    κ(C)    κAκB.\frac{\kappa_B}{\kappa_A} \;\le\; \kappa(C) \;\le\; \kappa_A\,\kappa_B.

The lower bound is the ratio that the intuition reaches for, and the upper is the product. Both are attained, and which one the composite lands on is decided entirely by the relative orientation of the two projections’ principal directions: aligned directions give the ratio, because the stretch of one partly undoes the stretch of the other, and directions at forty-five degrees give the product, because neither undoes anything.

That reading settles the essay’s own asymmetry, which is otherwise puzzling. When the source is conformal, κ_A = 1 and the two bounds collapse onto κ_B — the composite’s anisotropy is exactly the target’s and the ratio rule happens to be right, which is the measured gap of 0.00 for Mercator to Mollweide. When the target is conformal, κ_B = 1 and the bounds are 1/κ_A and κ_A, which do not collapse; the composite sits on the upper one, because a similarity applied after an anisotropic map cannot remove its anisotropy. The ratio rule then predicts 1/κ_A where the answer is κ_A, and the measured gap of 13.9 is exactly that reciprocal.

So the rule the ratio intuition is a special case of is: the anisotropy of a composite is bounded between the ratio and the product, and it is the ratio only when one of the two maps has no anisotropy to contribute. Anything else needs the directions, which no distortion table records.

The areal factor escapes all of this for a reason worth naming beside the bounds. A determinant is a homomorphism — det(XY) = det X det Y, exactly, with no inequality and no dependence on orientation — while the condition number is only submultiplicative. The whole of areas compose and shapes do not is that one word. It is also why the areal identity is verified to 7 × 10⁻¹⁵ and the shape identity is not verified at all: one of them is an algebraic law and the other was never a law.

The practical form is a bound rather than a value, and a bound is still useful. Two projections with anisotropies of 1.2 and 1.5 cannot compose to more than 1.8 whatever their orientations, so a conversion between two mildly distorting maps is guaranteed mild. It is only when one of the two ends is badly anisotropic that the composite can be worse than either, and it can then be as bad as their product.

What was computed, and how

Every figure here rests on one function. It takes two projection objects and a point, calls the same central-difference Jacobian the rest of the site uses — Richardson-extrapolated, so its noise floor is around 10⁻⁹ rather than 10⁻⁶ — inverts the first, multiplies, and reads the singular values off the resulting 2 × 2 matrix in closed form. No iteration and no fitting is involved anywhere.

Two independent checks hold it up. The first is the identity above: the composite’s areal factor must equal the ratio of the two projections’ own, and that comparison uses two entirely different code paths — one differentiates the composite, the other differentiates each projection against the sphere’s metric and divides. The second is the conformal pair, where the answer is known in advance to be zero and the measurement has to find it.

There is a third check, and it is the one that caught a real error. The first version sampled longitudes including exactly ±180°, which is where every cylindrical and conic projection is cut. A Jacobian taken across that cut measures the cut: the composite of two conformal projections reported 180° of angular deformation — the signature of a flipped Jacobian — and the assertion that conformal pairs deform nothing failed on a claim that is true. Sampling at cell centres fixed it, and the seam is now excluded rather than absorbed into a tolerance.

A chain that returns to its start

Three reprojections, each one deforming, and a chain that does not. The angular deformation of each step of a chain that starts in the plate carrée, goes through Mollweide and Mercator, and comes back. Every step deforms by tens of degrees. The whole chain deforms by 0.0e+0°, because the composite of a map with its own inverse is the identity however many steps are in between — the deformation of a chain is not the sum of its steps' deformations, and this is the cleanest case of it. What a chain does cost is resampling, which is a different quantity and is measured on the ladder about what a machine does with a raster.
Fig. 6 Three reprojections, each deforming by tens of degrees, and the chain they make, which deforms by 10⁻⁹ degrees. The composite of a map with its own inverse is the identity however many steps are in between.

Take a file in the plate carrée, convert it to Mollweide, then to Mercator, then back to the plate carrée. Every step deforms — 120°, 120°, 96° — and the chain deforms by 4 × 10⁻¹⁰ degrees, which is nothing.

That is worth saying plainly because the opposite is often assumed. Reprojection is spoken of as something that accumulates: convert a file often enough and it degrades. As a statement about the geometry, that is false, and the figure is the proof: transformations compose, and a transformation composed with its own inverse is the identity exactly, at every point, regardless of what happened in between.

Where the model stops

What degrades is not the geometry. It is the sampling.

A raster warped to Mercator and back, nearest against bilinear. The left panel is the field the raster carries — a smooth analytic function, so that the error of an interpolation is the interpolation's error and not a photograph's history. The other panels are what is left after warping into Mercator and back to Mollweide, shown as the difference from the original at six times the contrast. Nothing moved: the coordinates go through the maps exactly. What is lost is that a target pixel's centre does not fall on a source pixel's centre, so a value has to be invented for it. Bilinear is closer to the field — RMS 0.0013 against 0.0110 — and has given up 0.36 per cent of its variance to get there. The panels are drawn at 48 by 32 cells; the measurement is made at the same resolution.
Fig. 7 The same reprojection applied to a raster and undone, with two resampling kernels. The geometry returns to where it started; the values do not, and what the round trip has cost is a property of the interpolation rather than of the transformation.

A vector coordinate carries no error through a chain of reprojections beyond the arithmetic’s own. A raster does, because it has to be resampled at every step: its cells are a grid in one plane and not a grid in the other, so values are invented at the new grid’s positions and the invention is irreversible. That is a separate quantity with its own machinery, and it is measured on the ladder about what a machine does with a stored geometry — reprojecting a raster invents values fits the orders of convergence, and an edge has no order of convergence shows where those orders stop meaning anything.

The distinction matters because the two are routinely conflated. Reprojecting damages the data is true of a raster and false of a vector, and the reason is not that one is more delicate: it is that the geometry composes exactly and the sampling does not.

Two other limits are worth naming. The composite is undefined wherever either projection is — the transformation from a gnomonic plane has nothing to say about the far hemisphere, because A⁻¹ does not exist there. And the whole treatment assumes both maps are of the same body: a reprojection between two projections of different ellipsoids is not a plane-to-plane map at all but a datum transformation wearing one, which is the error that dwarfs every projection argument.

The two maps, seen the ordinary way

The same point at 20°, 60° under two projections. One circle on the sphere, two projections, two ellipses. A conformal projection keeps it circular and lets the area run; an equal-area projection keeps the area and lets the shape go. Nothing keeps both, and the dashed circle shows what keeping both would look like.
Fig. 8 The two projections’ own indicatrices at 20° east, 60° north — the comparison every other essay on this ladder makes. Mollweide’s ellipse has an areal factor of 1 and an angular deformation of 22°; Mercator’s is a circle four times too large. Neither of these is the ellipse the transformation between them produces.

Put the ordinary picture beside the composite one and the difference is immediate. Against the sphere, Mollweide at this point deforms angles by 22° and preserves area; Mercator preserves angles and inflates area fourfold. Against each other, the transformation deforms angles by 21.5° and inflates area fourfold — the areal factor is the ratio, as it must be, and the angular deformation is neither the sum, the difference, nor the larger of the two.

Each of the three pictures is correct about its own question. What none of them is, is a substitute for the others.

The generalisation

The construction has nothing to do with maps in particular. Given any two smooth maps of the same domain, the composite of one with the inverse of the other is a map whose derivative is the product, and every multiplicative quantity built from a determinant will divide while every quantity built from eigenvalue ratios of a non-symmetric product will not. The areal factor divides because it is a determinant; the deformation does not because it is not.

That is the honest form of a rule the subject already half-knows. Areas compose; shapes do not. A cartographer who has internalised the first and assumed the second has an intuition that works on every equal-area question and fails on every conformal one, and the failure is invisible because both maps involved look fine.

What a pipeline should do with this

Three practical consequences, each of which follows from the arithmetic above rather than from taste.

Reproject vectors freely. A chain of coordinate transformations between projections is exact to the arithmetic’s own precision and composes to the identity if it returns to its start. There is no accumulation to avoid and no reason to preserve an original file for fear of degradation.

Reproject rasters once. Every warp resamples, every resampling invents values at the new grid’s positions, and the invention is irreversible — so a chain of five reprojections has resampled five times and each one has cost what the ladder about stored geometry measures.

And check which end is conformal before blaming the transformation for a shape. If both ends are conformal the transformation cannot have changed a shape, so a shape that looks wrong after such a conversion was wrong before it, or was drawn wrong afterwards. That is a diagnostic rather than a platitude: it removes one candidate explanation entirely, by measurement.

Who found it, and when

Tissot published the indicatrix in 1881 for maps of the sphere, and the linear-algebra content of it — that the derivative of a smooth map is a matrix and that a matrix carries a circle to an ellipse — was already old. The application to a plane-to-plane transformation is not a discovery so much as a refusal to specialise: nothing in Tissot’s argument uses the sphere, and dropping the sphere is a matter of noticing rather than of proving.

The composite’s independence from the metric has a more specific home. It is the reason the coordinate-transformation half of a geospatial library can be, and is, written entirely in terms of projection parameters, while the datum half needs an ellipsoid, a set of marked stones and a date. Whoever first drew that boundary in software drew it because the arithmetic falls that way.

Where the ladder goes next

This rung leaves the sphere on one side of the comparison and puts a picture there instead. What it does not do is ask the inverse question: given a picture, and no statement of which projection it is in, can the projection be recovered? That is a fit rather than a differentiation, it is what a reader of somebody else’s map actually has, and it is where the identify ladder starts — with a map does not say what it is, which fits every candidate in the library to a published graticule and ranks what is left over.

Named alongside this one

Essays reaching for the same objects. Nobody chose these; they are what the concept index makes visible.

What links here

Every essay whose body links to this one.

The objects this essay names

Each one links to every other essay that touches it.

Angular deformationAreal factorCompositionConformalityDeterminantIsometric latitudeJacobianMetricPrincipal scalesReprojectionResamplingTissot's indicatrix