What the numbers refer to

A chain of transformations does not close

Two datum transformations applied one after the other are not the sum of their fourteen published numbers. The gap is seven millimetres in Britain, doing the two in the other order moves the answer twenty, and the rotation matrix everybody prints is not a rotation.

Eight essays on this ladder transform a coordinate once. A datum is fitted to a region, its seven parameters are published, a mark moves a few hundred metres, and the argument is about what the parameters mean and what they leave behind. Nobody has yet applied two of them in a row.

Real work does it constantly. A survey observed on one national datum is wanted on another; a dataset arrives on a third; a pipeline converts through whatever it has parameters for. And there is an obvious way to do it, which appears in code, in specifications and in textbooks: add the parameters. Three translations add, three rotations add, the scale adds, and the result is a seven-parameter transformation that does both steps at once.

It is not the same transformation, and the difference is large enough to matter to the work these numbers exist for.

OSGB36 then DHDN, done four ways. How far each route lands from the truth — applying the two transformations one after the other — at 54.5° north, 2.0° west. Composing them into one affine map is exact, because two affine maps compose into an affine map and nothing is dropped. Describing that composition with seven parameters again leaves 0.19 millimetres, because two linearised rotations compose into something with a symmetric part that seven numbers cannot hold. Adding the fourteen published numbers in pairs — which is what a chain is usually done with — leaves 7.4 millimetres. Logarithmic from a micrometre.
Fig. 1 Four routes from a mark in northern England through two published transformations, measured against the truth — applying the two one after the other. Composing them into a single affine map is exact. Adding the fourteen published numbers in pairs is out by 7.4 millimetres, on a line of work whose whole point is millimetres.

Why there is anything to get wrong

A seven-parameter transformation is an affine map of three-dimensional Cartesian space:

X=t+sMXX' = t + s\,M\,X

with t the three translations, s one plus the scale in parts per million, and M a rotation matrix built from three angles measured in arcseconds. Two affine maps compose into an affine map, exactly, with no approximation anywhere:

X=(t2+s2M2t1)+(s1s2)(M2M1)XX'' = \left(t_2 + s_2 M_2 t_1\right) + \left(s_1 s_2\right)\left(M_2 M_1\right) X

The composed translation is not t₁ + t₂. It is t₂ + s₂M₂t₁ — the second transformation’s scale and rotation acting on the first transformation’s translation before the two are added.

That term is not small, because a datum translation is not small. Britain’s OSGB36 sits 713 metres from the geocentre and Germany’s DHDN sits 734, because a datum is fitted to a region rather than to the planet. The second transformation’s scale of 6.7 parts per million acting on the first’s 713 metres is 4.8 millimetres, and its rotation of 2.46 arcseconds acting on the same translation is up to 8.5 more. The measured discrepancy in northern England is 7.4 millimetres, and it comes out of exactly those two terms.

Written as parameters, the two answers differ where it is easiest to miss. The composed transformation has translations of 1,044.5496, −51.4637 and 960.2634 metres; the summed one has 1,044.548, −51.457 and 960.260. The rotations and the scale agree to every digit anyone prints. It is only the translations that move, by one, seven and three millimetres.

The size of it, across a country

The error from adding the parameters, across a country. The mistake is not a constant. Adding two transformations' parameters instead of composing them leaves between 7.3 and 7.4 millimetres over the forty-nine marks drawn here, sized by how far each one is out. The variation is small because the dominant term is a scale acting on a translation and neither depends on position — but it is not zero, so the error cannot be absorbed into a datum's own definition and has to be avoided instead. Drawn in Lambert conformal conic.
Fig. 2 The error from adding the parameters at forty-nine marks across Britain, sized by how far each is out. It runs from 7.34 to 7.40 millimetres — nearly constant, because the dominant term depends on the two transformations and not on where the mark is.

The near-constancy is worth reading carefully, because it decides what kind of mistake this is. An error that varied across the country would look like a distortion and could be absorbed into a datum’s own definition — that is what where a fit leaves residuals is about, and a pattern in a residual is a signal that the model is missing a term.

This one does not vary, so it cannot be absorbed and cannot be diagnosed from the residuals of a network. It is a systematic shift of the whole country by seven millimetres, in a fixed direction, introduced by the arithmetic rather than by the geodesy — a declaration that is not in the numbers, which is what a coordinate refers to applied to the transformation instead of to the point. The only way to see it is to compare against the composition, which is what a coordinate pipeline almost never does because both routes look like a transformation.

The order matters, and by a predictable amount

Transformations do not commute, and the size of it is predictable. Doing OSGB36's transformation and then DHDN's lands 20.0 millimetres from doing them the other way round. The second bar is the term that explains it, written out rather than fitted: each transformation's scale acting on the other's translation, which is parts per million times hundreds of metres. The third bar is the control — a chain that goes out to the hub datum and back closes to a nanometre, because every published transformation on this site is to the same hub and the loop is a transformation composed with its own exact inverse.
Fig. 3 Doing one transformation then the other, against doing them the other way round: 20.0 millimetres apart. The middle bar is the coupling term written out rather than fitted — each transformation’s scale acting on the other’s translation — at 19.5. The bottom bar is the control: a chain that goes out to the hub datum and back closes to a nanometre.

Composition is not commutative, which is a fact about matrices and is easy to say and easy to forget. Here it is 20 millimetres, and the term that dominates it is written out in the figure: (s₂ − 1)t₁ − (s₁ − 1)t₂, which is a part per million times seven hundred metres, twice. The predicted 19.5 against the measured 20.0 is the check that the explanation is the explanation and not a plausible story about a number.

The control matters as much as the measurement. Every transformation this site holds is published to WGS84, so any chain between two datums goes out to that hub and back, and the return leg is the exact inverse of a transformation the outbound leg already applied. Such a loop closes to 0.93 nanometres — which is the arithmetic’s floor and says that the machinery has no accumulating error of its own. The closure is a property of how the parameters are published, not a property of the transformations. A published direct transformation between two regional datums, fitted independently, would not close, and the residual would be the disagreement between two fits rather than a rounding error.

The rotation matrix is not a rotation

The published rotation matrix is not a rotation. A seven-parameter transformation writes its rotation as the identity plus a small skew matrix, which is accurate to the square of angles measured in arcseconds. It is also not orthogonal: it lengthens every vector it acts on by about half the square of the rotation angle, which is a scale error nobody wrote down and which is always in the same direction. The bars are that lengthening in millimetres on the Earth's radius. A transformation published with no rotations has none at all, which is the control — and a chain of twenty transformations accumulates the defect twenty times without ever cancelling it.
Fig. 4 How much longer a vector comes out after the published rotation matrix has acted on it, in millimetres on the Earth’s radius. A transformation with no rotations has no defect at all, which is the control; DHDN’s 2.46 arcseconds cost 0.45 millimetres, and the effect is always in the same direction.

Every published seven-parameter set writes its rotation as the identity plus a small skew-symmetric matrix. For angles of a few arcseconds — a few millionths of a radian — that is an excellent approximation, and it is why the form survives.

It is also not orthogonal. I + skew(θ) sends a unit vector to one of length √(1 + θ²), so the “rotation” lengthens everything it touches by about θ²/2. For OSGB36’s 0.89 arcseconds that is 9.05 × 10⁻¹², which the closed form predicts at 9.32 × 10⁻¹² and which amounts to 0.058 millimetres on the Earth’s radius. For DHDN’s 2.46 arcseconds it is 0.45 millimetres.

Sub-millimetre effects are usually where an essay stops. This one is worth a sentence more for a reason that has nothing to do with its size: it is one-signed. A rounding error cancels over a chain and this does not — twenty transformations in a row accumulate twenty of them, all lengthening, never shrinking. It is the same shape of failure as the elevation term whose sign was wrong in a parcel’s area, caught here because two expressions of one quantity disagreed; a systematic error that never changes sign is worth more attention than a larger one that does.

What was computed, and how

The arithmetic is small and the checks are the substance.

Each published transformation is turned into its affine triple — a translation vector, a scale and a 3 × 3 matrix — by a function that does nothing but rearrange the seven numbers. Composition multiplies the matrices and transforms the first translation, which is nine multiplications. Applying either the composition or the two steps separately then gives two positions in geocentric Cartesian coordinates, and the quantity reported is the distance between them.

The first check is that the composition and the stepwise application agree exactly — the measured difference is zero to the last bit, because the two are the same arithmetic in a different order and any disagreement would be a transcription error. The second is that the seven-parameter description of the composition is close but not exact: 0.187 millimetres, which is the symmetric part that two linearised rotations produce when they are multiplied and which no skew matrix can hold. The third is the hub loop above.

The one thing this file does not do is invert a transformation by negating its parameters. That was already known here to be wrong by about a centimetre, because scaling and translating do not commute either; the inverse used throughout is the exact affine one, with the matrix inverted by cofactors rather than approximated.

The datum this needed

Two of the three datums on this site publish transformations with no rotations and no scale at all — ED50 and NAD27 are three-parameter shifts. With such a transformation second in the chain, adding the parameters is exactly right: s₂ = 1 and M₂ = I, so the composed translation really is the sum. The first version of this measurement used ED50 and reported a discrepancy of zero, which is a true answer to a question about the wrong pair.

DHDN to WGS84, one parameter at a time. Each bar is how far the mark at 10.0° east, 52.0° north moves under one of the seven parameters with the other six set to zero. seven of the seven are not zero for DHDN. The units hide the comparison: one arcsecond of rotation moves this point 30.7 metres and one part per million of scale moves it 6.36 metres, so DHDN's scale term contributes 43 metres — more than no of its three translations.
Fig. 5 The Potsdam datum’s own seven parameters, one at a time, as the distance each moves a mark near Berlin. This is the transformation whose rotations and scale make a chain worth measuring: 2.46 arcseconds of rotation and 6.7 parts per million, against ED50’s three translations and nothing else.

So the German datum was added, and the note is here rather than in a commit message because the shape of the mistake is general. A measurement whose result is zero because the case was degenerate looks exactly like a measurement whose result is zero because the effect is absent. The distinguishing test is to construct a case where the effect must be present and check that the machinery finds it, which is what every assertion on this site is for.

Every chain on this site goes through one place

The same coordinate on four datums. One pair of numbers — 2.0° east, 50.0° north — read as a coordinate on OSGB36, DHDN, ED50 and on WGS84, and plotted where each reading puts the mark on the ground. The spread runs to 150 metres. The numbers are identical; only what they refer to differs.
Fig. 6 How far the same latitude and longitude moves under each of three published transformations, at a mark on the Franco-Belgian border where all three datums have been used. The three answers are hundreds of metres apart, and the only reason a chain between any two of them closes at all is that each is published against the same hub.

The hub is WGS84, and it is a convention rather than a discovery. Before satellite geodesy there was nothing for a national datum to be published against except its neighbours, and transformations were fitted pair by pair across borders: France to Belgium, Belgium to the Netherlands, and no guarantee whatever that going round a loop returned to the start. The loop residual was a real quantity and a nuisance, and it was the sum of three independent fits’ disagreements rather than of any arithmetic.

Publishing everything against one global frame replaces that with a star. Any chain is then out and back through the centre, the return leg is an exact inverse, and the only residual left is the one this essay is about. That is a considerable engineering gain and it hides its own origin: a modern pipeline can compose transformations all day and see nothing wrong, because the closure it is relying on was designed in rather than measured.

The size of what the star arrangement absorbed is visible in the figure. Three transformations, three regional fits, hundreds of metres apart at a single mark — and a loop between any two of them that closes to a nanometre.

The check a pipeline runs cannot see this

There is a standard integrity test for a coordinate pipeline and it is the loop: transform a mark out to another datum and back, and see whether it returns to where it started. It is cheap, it needs no reference data, it catches transposed parameters and sign errors and wrong conventions, and every serious library ships something like it.

It is provably incapable of detecting the error this essay is about, and the reason is the star arrangement rather than any weakness in the test. Every published transformation here goes to the hub, so a chain from datum A to datum B is A→WGS84 followed by WGS84→B, and the return trip is B→WGS84 followed by WGS84→A. The four steps are two transformations and their exact inverses, in an order that cancels term by term whichever way the composition was formed — and the measured closure of 0.93 nanometres is that cancellation, not a verdict on the arithmetic. A pipeline that adds parameters instead of composing them makes the same wrong transformation on the way out and on the way back, and its loop closes exactly as well as a correct one’s.

So the seven millimetres is invisible to the only check that is routinely available. Catching it requires comparing two routes that are not inverses of each other — the composed affine map against the summed parameters — and that comparison is not a test a pipeline can run on itself, because a pipeline that had both routes implemented would presumably be using the right one.

That is worth naming because it changes what kind of defect this is. An error a self-test can find is a bug: it shows up, somebody fixes it. An error that survives every self-test is a convention — it propagates, it gets copied into the next library, and the only thing that finds it is somebody deriving the composition on paper and checking. The one-signed rotation defect above has the same property for the same reason: it is present in the outbound leg and in the return leg, and a loop cancels it too.

An approximation composed with an approximation

Molodensky against the exact route, NAD27. The distance on the ground between where each shortcut puts the transformed point and where the exact Cartesian route puts it, at 0 metres of ellipsoidal height, on a logarithmic scale. The full formulae stay within 0.7 centimetres across every latitude drawn; the abridged form, which replaces two ellipsoid-difference coefficients with one combined term, is worst at 39 centimetres — a factor of 58. The abridged curve dips near 45°, where the combined coefficient happens to equal the pair it replaces.
Fig. 7 The error of Molodensky’s direct formula against the exact transformation, at four latitudes, for the one datum in this table whose transformation the formula can represent — three translations and no rotations. A shortcut of this size composed twice does not double: the two errors are functions of position, and at the second step the position is already slightly wrong.

There is a second way for a chain to go wrong and it is worth separating from the first. Everything above assumes each step is applied exactly. In practice a step may be Molodensky’s shortcut — a direct formula that avoids an iteration — or a grid of tabulated shifts interpolated between its nodes, and both are approximations with errors of their own.

Composing two approximations is not the same as approximating the composition. Each shortcut’s error is a function of where the point is, and after the first step the point is a few centimetres from where the exact transformation would have put it, so the second shortcut is evaluated at a slightly wrong position and returns a slightly different error than it would have alone. The effect is second order and it is not zero, which is the general shape of the thing: a chain of approximations has an error that the individual errors do not predict, and the only reliable route is to compose the exact transformations and approximate once at the end.

That is the same argument as the arithmetic one, at a different scale. Do the exact thing as long as possible; approximate last.

The practical form of that is short. A pipeline cannot verify this property; it can only be built to have it, by composing affine maps and never adding parameter records. The test belongs in the library’s own suite, against a case constructed to have the coupling term, rather than in the pipeline’s runtime checks where nothing it could measure would show.

Where the model stops

Three limits, each of which would change a number here.

The transformations are treated as exact. They are fits, and two parameter sets can describe one transformation while differing by hundreds of metres in their translations — so a chain built from two published sets inherits both fits’ own residuals, which are metres over a national network and dwarf every millimetre discussed here. What is being measured is the arithmetic of composing them, not the accuracy of the result.

The rotation convention is assumed. A published set may be in the position-vector convention or the coordinate-frame one, and the two differ by the sign of all three rotations; getting it wrong moves a mark by twice the rotation term, which for DHDN is metres rather than millimetres. Nothing in the seven numbers says which convention they are in.

And the epoch is assumed to be shared. Composing two transformations between datums realised at different dates ignores everything the epoch is part of the coordinate is about: the ground moves at tens of millimetres a year, so two transformations twenty years apart differ by far more than any term here.

The generalisation

The rule underneath is one line of algebra and applies wherever transformations are published as parameter lists: parameters describe a transformation, and transformations compose while parameters do not. Anything that acts on a coordinate by scaling, rotating and shifting has this property, and the term that breaks the addition is always the same one — the later transformation’s linear part acting on the earlier one’s offset.

The place it bites hardest is not geodesy but any pipeline that treats a transformation as a record with seven fields. Records add; maps compose. The distinction is invisible in the data structure and worth seven millimetres per link in the chain.

Who found it, and when

Helmert’s transformation dates from 1880 and the linearised form is as old as the practice of publishing datum shifts. The non-commutativity is not a discovery: it is a property of matrix multiplication that no geodesist has ever doubted.

What is worth recording is why the addition rule is nevertheless everywhere. It is exactly right for the three-parameter shifts that dominated published transformations until satellite geodesy, because a translation-only transformation has an identity for its linear part and therefore commutes with everything. The rule was correct for the transformations of its own era, and it survived into an era of seven-parameter sets where it is not.

Where the ladder goes next

This rung composes two transformations and finds the arithmetic of doing it. It says nothing about what a chain does to a distance rather than a point — a systematic scale of a few parts per million acting on a survey network is a different quantity, and it is measured on the ladder about what a survey actually does, where a published coordinate is a result and where the chain from an instrument reading to a grid coordinate is taken apart step by step.

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.

AffineClosed formCompositionConventionDatum transformationGeodetic datumHelmert transformationHub datumLinearisationRealisationRotation matrixScale factorSeven parameters