FA-70321 / Map projection transforms / Open access
Seven-parameter Helmert datum shift: frame rotation transpose · case 01
Coordinate-frame shifts are right only when two of the rotations are zero.
ROOT CAUSE
Only the z rotation is negated when switching to the coordinate-frame convention.
VERIFIED REPAIR
At the frame rotation transpose step restore `rx, ry, rz = -rx, -ry, -rz`, leaving the rest of the model unchanged.
Unsuccessful approach: The x and y rotations are negated but the z rotation is not.
Case contract
Input [X, Y, Z, tx, ty, tz, rx, ry, rz, s, convention] with metres, rotations in arc-seconds and scale in ppm. Rotations are converted to radians; for "coordinate_frame" they are negated, for "position_vector" used as is. m = 1 + s*1e-6. X' = tx + m(X - rz Y + ry Z); Y' = ty + m(rz X + Y - rx Z); Z' = tz + m(-ry X + rx Y + Z). Return [X', Y', Z'] rounded to 3 decimals.
Why this case matters
Datum transformations between national and global frames use these seven parameters; convention and unit slips cause metre-level offsets that pass casual inspection.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
X, Y, Z, tx, ty, tz, rx, ry, rz, s, conv = x
k = math.pi / (180 * 3600)
rx, ry, rz = rx * k, ry * k, rz * k
if conv == 'coordinate_frame':
rz = -rz
m = 1 + s * 1e-6
Xo = tx + m * (X - rz * Y + ry * Z)
Yo = ty + m * (rz * X + Y - rx * Z)
Zo = tz + m * (-ry * X + rx * Y + Z)
return [round(Xo, 3), round(Yo, 3), round(Zo, 3)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [-5541091.088, -2232325.705, -6352955.267, -217.202, 252.693, 193.877, -0.3013, 2.5369, -0.4898, 7.2933, 'coordinate_frame'], [-5541265.265, -2232093.171, -6352879.137]), ('control #1', [-4612717.254, 854010.104, -297229.761, 35.767, -284.925, 195.294, -3.1116, -2.0049, -2.6038, -4.6626, 'position_vector'], [-4612646.31, 853774.942, -297090.8]), ('control #2', [1975468.993, -227743.085, 2770505.24, 403.916, 391.722, 260.454, 2.194, 0.0057, 3.3578, 9.7343, 'coordinate_frame'], [1975888.355, -227356.269, 2770795.14]), ('control #3', [-189321.127, 3352090.605, -2404357.859, -152.685, 61.282, -123.245, -4.7005, -0.5925, -4.5929, 7.6062, 'coordinate_frame'], [-189556.8, 3352227.961, -2404422.458]), ('control #4', [-6228293.209, -1104665.934, 4388800.498, 448.343, 5.84, -248.246, 0.9162, -1.8119, 1.9656, -3.1531, 'position_vector'], [-6227853.253, -1104735.458, 4388478.796]), ('control #5', [-2535544.339, -5957215.045, -4097405.578, -66.0, -207.215, 331.819, 3.4107, -4.2707, 0.0925, 8.1975, 'position_vector'], [-2535543.615, -5957404.478, -4097258.353]), ('control #6', [3627823.551, 5819563.217, -5921733.519, 228.087, -10.934, -497.542, -2.8114, -0.0659, -0.388, 7.4115, 'coordinate_frame'], [3628065.687, 5819682.953, -5922196.787]), ('control #7', [-1973240.205, 3874957.505, 5178356.07, -328.689, -442.829, -41.798, -4.7714, -2.8648, -4.9782, -2.8322, 'position_vector'], [-1973541.705, 3874671.113, 5178182.563])], [('control #2', [1975468.993, -227743.085, 2770505.24, 403.916, 391.722, 260.454, 2.194, 0.0057, 3.3578, 9.7343, 'coordinate_frame'], [1975888.355, -227356.269, 2770795.14]), ('control #3', [-189321.127, 3352090.605, -2404357.859, -152.685, 61.282, -123.245, -4.7005, -0.5925, -4.5929, 7.6062, 'coordinate_frame'], [-189556.8, 3352227.961, -2404422.458]), ('control #5', [-2535544.339, -5957215.045, -4097405.578, -66.0, -207.215, 331.819, 3.4107, -4.2707, 0.0925, 8.1975, 'position_vector'], [-2535543.615, -5957404.478, -4097258.353]), ('control #6', [3627823.551, 5819563.217, -5921733.519, 228.087, -10.934, -497.542, -2.8114, -0.0659, -0.388, 7.4115, 'coordinate_frame'], [3628065.687, 5819682.953, -5922196.787]), ('control #7', [-1973240.205, 3874957.505, 5178356.07, -328.689, -442.829, -41.798, -4.7714, -2.8648, -4.9782, -2.8322, 'position_vector'], [-1973541.705, 3874671.113, 5178182.563]), ('control #8', [3575522.137, 5452586.84, 1656910.978, 298.786, 393.9, -294.606, 0.0728, 4.841, -0.7608, 8.8812, 'position_vector'], [3575911.678, 5453015.392, 1656549.094]), ('control #9', [-1240296.101, -552884.937, -952528.764, -360.154, 285.951, 384.058, -2.5191, -3.2475, 0.9833, 0.1835, 'position_vector'], [-1240638.85, -552616.633, -952157.656]), ('control #10', [1307969.679, 563540.708, -1431729.813, -333.759, -148.113, 140.284, -1.8868, 2.9579, 1.9314, -9.4043, 'position_vector'], [1307597.811, 563386.446, -1431599.976])], [('control #3', [-189321.127, 3352090.605, -2404357.859, -152.685, 61.282, -123.245, -4.7005, -0.5925, -4.5929, 7.6062, 'coordinate_frame'], [-189556.8, 3352227.961, -2404422.458]), ('control #6', [3627823.551, 5819563.217, -5921733.519, 228.087, -10.934, -497.542, -2.8114, -0.0659, -0.388, 7.4115, 'coordinate_frame'], [3628065.687, 5819682.953, -5922196.787]), ('control #8', [3575522.137, 5452586.84, 1656910.978, 298.786, 393.9, -294.606, 0.0728, 4.841, -0.7608, 8.8812, 'position_vector'], [3575911.678, 5453015.392, 1656549.094]), ('control #9', [-1240296.101, -552884.937, -952528.764, -360.154, 285.951, 384.058, -2.5191, -3.2475, 0.9833, 0.1835, 'position_vector'], [-1240638.85, -552616.633, -952157.656]), ('control #10', [1307969.679, 563540.708, -1431729.813, -333.759, -148.113, 140.284, -1.8868, 2.9579, 1.9314, -9.4043, 'position_vector'], [1307597.811, 563386.446, -1431599.976]), ('control #11', [-3904352.966, -2722509.047, -2822388.255, 181.432, 495.341, 160.587, -1.285, -3.3165, -0.7058, 5.5208, 'position_vector'], [-3904157.024, -2722032.96, -2822289.067]), ('control #12', [2647634.641, -1578921.141, -5093066.149, -355.392, 203.405, 165.947, 0.2987, -4.1705, -3.9905, -0.2744, 'position_vector'], [2647350.953, -1578761.15, -5092847.558]), ('control #13', [-3520096.56, -3120177.457, -123254.85, 462.196, 402.077, 308.458, 1.3023, 3.5694, 0.8414, 8.6398, 'position_vector'], [-3519654.182, -3119815.919, -122906.241])], [('control #6', [3627823.551, 5819563.217, -5921733.519, 228.087, -10.934, -497.542, -2.8114, -0.0659, -0.388, 7.4115, 'coordinate_frame'], [3628065.687, 5819682.953, -5922196.787]), ('control #10', [1307969.679, 563540.708, -1431729.813, -333.759, -148.113, 140.284, -1.8868, 2.9579, 1.9314, -9.4043, 'position_vector'], [1307597.811, 563386.446, -1431599.976]), ('control #11', [-3904352.966, -2722509.047, -2822388.255, 181.432, 495.341, 160.587, -1.285, -3.3165, -0.7058, 5.5208, 'position_vector'], [-3904157.024, -2722032.96, -2822289.067]), ('control #12', [2647634.641, -1578921.141, -5093066.149, -355.392, 203.405, 165.947, 0.2987, -4.1705, -3.9905, -0.2744, 'position_vector'], [2647350.953, -1578761.15, -5092847.558]), ('control #13', [-3520096.56, -3120177.457, -123254.85, 462.196, 402.077, 308.458, 1.3023, 3.5694, 0.8414, 8.6398, 'position_vector'], [-3519654.182, -3119815.919, -122906.241]), ('control #14', [-6389654.874, -3984093.2, -3011962.836, 356.165, -201.583, 189.984, 2.6426, 1.938, -0.6636, -3.7122, 'coordinate_frame'], [-6389233.872, -3984339.138, -3011770.663]), ('control #15', [4550537.139, 2792317.331, 1441981.13, 76.583, -265.303, -460.556, -0.538, -4.9358, -3.9263, 0.893, 'coordinate_frame'], [4550599.139, 2792137.381, 1441420.253]), ('control #16', [6034311.204, -4464484.503, 922428.188, 291.409, -257.511, -47.177, 0.8272, -3.8801, -0.5275, 8.0745, 'position_vector'], [6034622.567, -4464797.194, 922484.069])], [('control #12', [2647634.641, -1578921.141, -5093066.149, -355.392, 203.405, 165.947, 0.2987, -4.1705, -3.9905, -0.2744, 'position_vector'], [2647350.953, -1578761.15, -5092847.558]), ('control #13', [-3520096.56, -3120177.457, -123254.85, 462.196, 402.077, 308.458, 1.3023, 3.5694, 0.8414, 8.6398, 'position_vector'], [-3519654.182, -3119815.919, -122906.241]), ('control #14', [-6389654.874, -3984093.2, -3011962.836, 356.165, -201.583, 189.984, 2.6426, 1.938, -0.6636, -3.7122, 'coordinate_frame'], [-6389233.872, -3984339.138, -3011770.663]), ('control #15', [4550537.139, 2792317.331, 1441981.13, 76.583, -265.303, -460.556, -0.538, -4.9358, -3.9263, 0.893, 'coordinate_frame'], [4550599.139, 2792137.381, 1441420.253]), ('control #16', [6034311.204, -4464484.503, 922428.188, 291.409, -257.511, -47.177, 0.8272, -3.8801, -0.5275, 8.0745, 'position_vector'], [6034622.567, -4464797.194, 922484.069]), ('control #17', [5230974.683, -6230904.331, 2167328.689, 237.623, -185.552, -261.576, 1.7677, -1.5195, 4.1454, -3.6432, 'coordinate_frame'], [5231083.99, -6231153.737, 2167074.081]), ('control #18', [-1470319.114, 2740548.116, 5125620.909, 221.777, -218.178, -383.42, 0.9421, 2.6081, 1.1154, -5.3136, 'coordinate_frame'], [-1470139.515, 2740346.737, 5125179.145]), ('control #19', [-529746.466, -5359638.341, -3123219.208, -191.594, -97.844, -141.662, -3.4167, -1.306, 1.572, 1.687, 'position_vector'], [-529878.331, -5359800.999, -3123280.712])]]
for label, args, expected in fixtures[N-1]:
check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control #0 | [-5541421.539, -2232111.731, -6352736.311] | [-5541265.265, -2232093.171, -6352879.137] | Failed |
| control #1 | [-4612646.31, 853774.942, -297090.8] | [-4612646.31, 853774.942, -297090.8] | Passed |
| control #2 | [1975888.508, -227415.209, 2770790.186] | [1975888.355, -227356.269, 2770795.14] | Failed |
| control #3 | [-189542.987, 3352118.375, -2404576.326] | [-189556.8, 3352227.961, -2404422.458] | Failed |
| control #4 | [-6227853.253, -1104735.458, 4388478.796] | [-6227853.253, -1104735.458, 4388478.796] | Passed |
| control #5 | [-2535543.615, -5957404.478, -4097258.353] | [-2535543.615, -5957404.478, -4097258.353] | Passed |
| control #6 | [3628069.47, 5819521.525, -5922353.112] | [3628065.687, 5819682.953, -5922196.787] | Failed |
| control #7 | [-1973541.705, 3874671.113, 5178182.563] | [-1973541.705, 3874671.113, 5178182.563] | Passed |
SHA-256 / 20431685c6c347c8a6187a5a4f808da1d7961ce7d3587ea60c6418c05fd5fa5e
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
X, Y, Z, tx, ty, tz, rx, ry, rz, s, conv = x
k = math.pi / (180 * 3600)
rx, ry, rz = rx * k, ry * k, rz * k
if conv == 'coordinate_frame':
rx, ry = -rx, -ry
m = 1 + s * 1e-6
Xo = tx + m * (X - rz * Y + ry * Z)
Yo = ty + m * (rz * X + Y - rx * Z)
Zo = tz + m * (-ry * X + rx * Y + Z)
return [round(Xo, 3), round(Yo, 3), round(Zo, 3)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [-5541091.088, -2232325.705, -6352955.267, -217.202, 252.693, 193.877, -0.3013, 2.5369, -0.4898, 7.2933, 'coordinate_frame'], [-5541265.265, -2232093.171, -6352879.137]), ('control #1', [-4612717.254, 854010.104, -297229.761, 35.767, -284.925, 195.294, -3.1116, -2.0049, -2.6038, -4.6626, 'position_vector'], [-4612646.31, 853774.942, -297090.8]), ('control #2', [1975468.993, -227743.085, 2770505.24, 403.916, 391.722, 260.454, 2.194, 0.0057, 3.3578, 9.7343, 'coordinate_frame'], [1975888.355, -227356.269, 2770795.14]), ('control #3', [-189321.127, 3352090.605, -2404357.859, -152.685, 61.282, -123.245, -4.7005, -0.5925, -4.5929, 7.6062, 'coordinate_frame'], [-189556.8, 3352227.961, -2404422.458]), ('control #4', [-6228293.209, -1104665.934, 4388800.498, 448.343, 5.84, -248.246, 0.9162, -1.8119, 1.9656, -3.1531, 'position_vector'], [-6227853.253, -1104735.458, 4388478.796]), ('control #5', [-2535544.339, -5957215.045, -4097405.578, -66.0, -207.215, 331.819, 3.4107, -4.2707, 0.0925, 8.1975, 'position_vector'], [-2535543.615, -5957404.478, -4097258.353]), ('control #6', [3627823.551, 5819563.217, -5921733.519, 228.087, -10.934, -497.542, -2.8114, -0.0659, -0.388, 7.4115, 'coordinate_frame'], [3628065.687, 5819682.953, -5922196.787]), ('control #7', [-1973240.205, 3874957.505, 5178356.07, -328.689, -442.829, -41.798, -4.7714, -2.8648, -4.9782, -2.8322, 'position_vector'], [-1973541.705, 3874671.113, 5178182.563])], [('control #2', [1975468.993, -227743.085, 2770505.24, 403.916, 391.722, 260.454, 2.194, 0.0057, 3.3578, 9.7343, 'coordinate_frame'], [1975888.355, -227356.269, 2770795.14]), ('control #3', [-189321.127, 3352090.605, -2404357.859, -152.685, 61.282, -123.245, -4.7005, -0.5925, -4.5929, 7.6062, 'coordinate_frame'], [-189556.8, 3352227.961, -2404422.458]), ('control #5', [-2535544.339, -5957215.045, -4097405.578, -66.0, -207.215, 331.819, 3.4107, -4.2707, 0.0925, 8.1975, 'position_vector'], [-2535543.615, -5957404.478, -4097258.353]), ('control #6', [3627823.551, 5819563.217, -5921733.519, 228.087, -10.934, -497.542, -2.8114, -0.0659, -0.388, 7.4115, 'coordinate_frame'], [3628065.687, 5819682.953, -5922196.787]), ('control #7', [-1973240.205, 3874957.505, 5178356.07, -328.689, -442.829, -41.798, -4.7714, -2.8648, -4.9782, -2.8322, 'position_vector'], [-1973541.705, 3874671.113, 5178182.563]), ('control #8', [3575522.137, 5452586.84, 1656910.978, 298.786, 393.9, -294.606, 0.0728, 4.841, -0.7608, 8.8812, 'position_vector'], [3575911.678, 5453015.392, 1656549.094]), ('control #9', [-1240296.101, -552884.937, -952528.764, -360.154, 285.951, 384.058, -2.5191, -3.2475, 0.9833, 0.1835, 'position_vector'], [-1240638.85, -552616.633, -952157.656]), ('control #10', [1307969.679, 563540.708, -1431729.813, -333.759, -148.113, 140.284, -1.8868, 2.9579, 1.9314, -9.4043, 'position_vector'], [1307597.811, 563386.446, -1431599.976])], [('control #3', [-189321.127, 3352090.605, -2404357.859, -152.685, 61.282, -123.245, -4.7005, -0.5925, -4.5929, 7.6062, 'coordinate_frame'], [-189556.8, 3352227.961, -2404422.458]), ('control #6', [3627823.551, 5819563.217, -5921733.519, 228.087, -10.934, -497.542, -2.8114, -0.0659, -0.388, 7.4115, 'coordinate_frame'], [3628065.687, 5819682.953, -5922196.787]), ('control #8', [3575522.137, 5452586.84, 1656910.978, 298.786, 393.9, -294.606, 0.0728, 4.841, -0.7608, 8.8812, 'position_vector'], [3575911.678, 5453015.392, 1656549.094]), ('control #9', [-1240296.101, -552884.937, -952528.764, -360.154, 285.951, 384.058, -2.5191, -3.2475, 0.9833, 0.1835, 'position_vector'], [-1240638.85, -552616.633, -952157.656]), ('control #10', [1307969.679, 563540.708, -1431729.813, -333.759, -148.113, 140.284, -1.8868, 2.9579, 1.9314, -9.4043, 'position_vector'], [1307597.811, 563386.446, -1431599.976]), ('control #11', [-3904352.966, -2722509.047, -2822388.255, 181.432, 495.341, 160.587, -1.285, -3.3165, -0.7058, 5.5208, 'position_vector'], [-3904157.024, -2722032.96, -2822289.067]), ('control #12', [2647634.641, -1578921.141, -5093066.149, -355.392, 203.405, 165.947, 0.2987, -4.1705, -3.9905, -0.2744, 'position_vector'], [2647350.953, -1578761.15, -5092847.558]), ('control #13', [-3520096.56, -3120177.457, -123254.85, 462.196, 402.077, 308.458, 1.3023, 3.5694, 0.8414, 8.6398, 'position_vector'], [-3519654.182, -3119815.919, -122906.241])], [('control #6', [3627823.551, 5819563.217, -5921733.519, 228.087, -10.934, -497.542, -2.8114, -0.0659, -0.388, 7.4115, 'coordinate_frame'], [3628065.687, 5819682.953, -5922196.787]), ('control #10', [1307969.679, 563540.708, -1431729.813, -333.759, -148.113, 140.284, -1.8868, 2.9579, 1.9314, -9.4043, 'position_vector'], [1307597.811, 563386.446, -1431599.976]), ('control #11', [-3904352.966, -2722509.047, -2822388.255, 181.432, 495.341, 160.587, -1.285, -3.3165, -0.7058, 5.5208, 'position_vector'], [-3904157.024, -2722032.96, -2822289.067]), ('control #12', [2647634.641, -1578921.141, -5093066.149, -355.392, 203.405, 165.947, 0.2987, -4.1705, -3.9905, -0.2744, 'position_vector'], [2647350.953, -1578761.15, -5092847.558]), ('control #13', [-3520096.56, -3120177.457, -123254.85, 462.196, 402.077, 308.458, 1.3023, 3.5694, 0.8414, 8.6398, 'position_vector'], [-3519654.182, -3119815.919, -122906.241]), ('control #14', [-6389654.874, -3984093.2, -3011962.836, 356.165, -201.583, 189.984, 2.6426, 1.938, -0.6636, -3.7122, 'coordinate_frame'], [-6389233.872, -3984339.138, -3011770.663]), ('control #15', [4550537.139, 2792317.331, 1441981.13, 76.583, -265.303, -460.556, -0.538, -4.9358, -3.9263, 0.893, 'coordinate_frame'], [4550599.139, 2792137.381, 1441420.253]), ('control #16', [6034311.204, -4464484.503, 922428.188, 291.409, -257.511, -47.177, 0.8272, -3.8801, -0.5275, 8.0745, 'position_vector'], [6034622.567, -4464797.194, 922484.069])], [('control #12', [2647634.641, -1578921.141, -5093066.149, -355.392, 203.405, 165.947, 0.2987, -4.1705, -3.9905, -0.2744, 'position_vector'], [2647350.953, -1578761.15, -5092847.558]), ('control #13', [-3520096.56, -3120177.457, -123254.85, 462.196, 402.077, 308.458, 1.3023, 3.5694, 0.8414, 8.6398, 'position_vector'], [-3519654.182, -3119815.919, -122906.241]), ('control #14', [-6389654.874, -3984093.2, -3011962.836, 356.165, -201.583, 189.984, 2.6426, 1.938, -0.6636, -3.7122, 'coordinate_frame'], [-6389233.872, -3984339.138, -3011770.663]), ('control #15', [4550537.139, 2792317.331, 1441981.13, 76.583, -265.303, -460.556, -0.538, -4.9358, -3.9263, 0.893, 'coordinate_frame'], [4550599.139, 2792137.381, 1441420.253]), ('control #16', [6034311.204, -4464484.503, 922428.188, 291.409, -257.511, -47.177, 0.8272, -3.8801, -0.5275, 8.0745, 'position_vector'], [6034622.567, -4464797.194, 922484.069]), ('control #17', [5230974.683, -6230904.331, 2167328.689, 237.623, -185.552, -261.576, 1.7677, -1.5195, 4.1454, -3.6432, 'coordinate_frame'], [5231083.99, -6231153.737, 2167074.081]), ('control #18', [-1470319.114, 2740548.116, 5125620.909, 221.777, -218.178, -383.42, 0.9421, 2.6081, 1.1154, -5.3136, 'coordinate_frame'], [-1470139.515, 2740346.737, 5125179.145]), ('control #19', [-529746.466, -5359638.341, -3123219.208, -191.594, -97.844, -141.662, -3.4167, -1.306, 1.572, 1.687, 'position_vector'], [-529878.331, -5359800.999, -3123280.712])]]
for label, args, expected in fixtures[N-1]:
check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control #0 | [-5541275.867, -2232066.855, -6352879.137] | [-5541265.265, -2232093.171, -6352879.137] | Failed |
| control #1 | [-4612646.31, 853774.942, -297090.8] | [-4612646.31, 853774.942, -297090.8] | Passed |
| control #2 | [1975895.77, -227291.951, 2770795.14] | [1975888.355, -227356.269, 2770795.14] | Failed |
| control #3 | [-189407.517, 3352236.392, -2404422.458] | [-189556.8, 3352227.961, -2404422.458] | Failed |
| control #4 | [-6227853.253, -1104735.458, 4388478.796] | [-6227853.253, -1104735.458, 4388478.796] | Passed |
| control #5 | [-2535543.615, -5957404.478, -4097258.353] | [-2535543.615, -5957404.478, -4097258.353] | Passed |
| control #6 | [3628087.581, 5819669.305, -5922196.787] | [3628065.687, 5819682.953, -5922196.787] | Failed |
| control #7 | [-1973541.705, 3874671.113, 5178182.563] | [-1973541.705, 3874671.113, 5178182.563] | Passed |
SHA-256 / 7d4bfca5f38cea21cf24d816a62d8b5ac782248574964ac9f69c46cf73e34f8d
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
X, Y, Z, tx, ty, tz, rx, ry, rz, s, conv = x
k = math.pi / (180 * 3600)
rx, ry, rz = rx * k, ry * k, rz * k
if conv == 'coordinate_frame':
rx, ry, rz = -rx, -ry, -rz
m = 1 + s * 1e-6
Xo = tx + m * (X - rz * Y + ry * Z)
Yo = ty + m * (rz * X + Y - rx * Z)
Zo = tz + m * (-ry * X + rx * Y + Z)
return [round(Xo, 3), round(Yo, 3), round(Zo, 3)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [-5541091.088, -2232325.705, -6352955.267, -217.202, 252.693, 193.877, -0.3013, 2.5369, -0.4898, 7.2933, 'coordinate_frame'], [-5541265.265, -2232093.171, -6352879.137]), ('control #1', [-4612717.254, 854010.104, -297229.761, 35.767, -284.925, 195.294, -3.1116, -2.0049, -2.6038, -4.6626, 'position_vector'], [-4612646.31, 853774.942, -297090.8]), ('control #2', [1975468.993, -227743.085, 2770505.24, 403.916, 391.722, 260.454, 2.194, 0.0057, 3.3578, 9.7343, 'coordinate_frame'], [1975888.355, -227356.269, 2770795.14]), ('control #3', [-189321.127, 3352090.605, -2404357.859, -152.685, 61.282, -123.245, -4.7005, -0.5925, -4.5929, 7.6062, 'coordinate_frame'], [-189556.8, 3352227.961, -2404422.458]), ('control #4', [-6228293.209, -1104665.934, 4388800.498, 448.343, 5.84, -248.246, 0.9162, -1.8119, 1.9656, -3.1531, 'position_vector'], [-6227853.253, -1104735.458, 4388478.796]), ('control #5', [-2535544.339, -5957215.045, -4097405.578, -66.0, -207.215, 331.819, 3.4107, -4.2707, 0.0925, 8.1975, 'position_vector'], [-2535543.615, -5957404.478, -4097258.353]), ('control #6', [3627823.551, 5819563.217, -5921733.519, 228.087, -10.934, -497.542, -2.8114, -0.0659, -0.388, 7.4115, 'coordinate_frame'], [3628065.687, 5819682.953, -5922196.787]), ('control #7', [-1973240.205, 3874957.505, 5178356.07, -328.689, -442.829, -41.798, -4.7714, -2.8648, -4.9782, -2.8322, 'position_vector'], [-1973541.705, 3874671.113, 5178182.563])], [('control #2', [1975468.993, -227743.085, 2770505.24, 403.916, 391.722, 260.454, 2.194, 0.0057, 3.3578, 9.7343, 'coordinate_frame'], [1975888.355, -227356.269, 2770795.14]), ('control #3', [-189321.127, 3352090.605, -2404357.859, -152.685, 61.282, -123.245, -4.7005, -0.5925, -4.5929, 7.6062, 'coordinate_frame'], [-189556.8, 3352227.961, -2404422.458]), ('control #5', [-2535544.339, -5957215.045, -4097405.578, -66.0, -207.215, 331.819, 3.4107, -4.2707, 0.0925, 8.1975, 'position_vector'], [-2535543.615, -5957404.478, -4097258.353]), ('control #6', [3627823.551, 5819563.217, -5921733.519, 228.087, -10.934, -497.542, -2.8114, -0.0659, -0.388, 7.4115, 'coordinate_frame'], [3628065.687, 5819682.953, -5922196.787]), ('control #7', [-1973240.205, 3874957.505, 5178356.07, -328.689, -442.829, -41.798, -4.7714, -2.8648, -4.9782, -2.8322, 'position_vector'], [-1973541.705, 3874671.113, 5178182.563]), ('control #8', [3575522.137, 5452586.84, 1656910.978, 298.786, 393.9, -294.606, 0.0728, 4.841, -0.7608, 8.8812, 'position_vector'], [3575911.678, 5453015.392, 1656549.094]), ('control #9', [-1240296.101, -552884.937, -952528.764, -360.154, 285.951, 384.058, -2.5191, -3.2475, 0.9833, 0.1835, 'position_vector'], [-1240638.85, -552616.633, -952157.656]), ('control #10', [1307969.679, 563540.708, -1431729.813, -333.759, -148.113, 140.284, -1.8868, 2.9579, 1.9314, -9.4043, 'position_vector'], [1307597.811, 563386.446, -1431599.976])], [('control #3', [-189321.127, 3352090.605, -2404357.859, -152.685, 61.282, -123.245, -4.7005, -0.5925, -4.5929, 7.6062, 'coordinate_frame'], [-189556.8, 3352227.961, -2404422.458]), ('control #6', [3627823.551, 5819563.217, -5921733.519, 228.087, -10.934, -497.542, -2.8114, -0.0659, -0.388, 7.4115, 'coordinate_frame'], [3628065.687, 5819682.953, -5922196.787]), ('control #8', [3575522.137, 5452586.84, 1656910.978, 298.786, 393.9, -294.606, 0.0728, 4.841, -0.7608, 8.8812, 'position_vector'], [3575911.678, 5453015.392, 1656549.094]), ('control #9', [-1240296.101, -552884.937, -952528.764, -360.154, 285.951, 384.058, -2.5191, -3.2475, 0.9833, 0.1835, 'position_vector'], [-1240638.85, -552616.633, -952157.656]), ('control #10', [1307969.679, 563540.708, -1431729.813, -333.759, -148.113, 140.284, -1.8868, 2.9579, 1.9314, -9.4043, 'position_vector'], [1307597.811, 563386.446, -1431599.976]), ('control #11', [-3904352.966, -2722509.047, -2822388.255, 181.432, 495.341, 160.587, -1.285, -3.3165, -0.7058, 5.5208, 'position_vector'], [-3904157.024, -2722032.96, -2822289.067]), ('control #12', [2647634.641, -1578921.141, -5093066.149, -355.392, 203.405, 165.947, 0.2987, -4.1705, -3.9905, -0.2744, 'position_vector'], [2647350.953, -1578761.15, -5092847.558]), ('control #13', [-3520096.56, -3120177.457, -123254.85, 462.196, 402.077, 308.458, 1.3023, 3.5694, 0.8414, 8.6398, 'position_vector'], [-3519654.182, -3119815.919, -122906.241])], [('control #6', [3627823.551, 5819563.217, -5921733.519, 228.087, -10.934, -497.542, -2.8114, -0.0659, -0.388, 7.4115, 'coordinate_frame'], [3628065.687, 5819682.953, -5922196.787]), ('control #10', [1307969.679, 563540.708, -1431729.813, -333.759, -148.113, 140.284, -1.8868, 2.9579, 1.9314, -9.4043, 'position_vector'], [1307597.811, 563386.446, -1431599.976]), ('control #11', [-3904352.966, -2722509.047, -2822388.255, 181.432, 495.341, 160.587, -1.285, -3.3165, -0.7058, 5.5208, 'position_vector'], [-3904157.024, -2722032.96, -2822289.067]), ('control #12', [2647634.641, -1578921.141, -5093066.149, -355.392, 203.405, 165.947, 0.2987, -4.1705, -3.9905, -0.2744, 'position_vector'], [2647350.953, -1578761.15, -5092847.558]), ('control #13', [-3520096.56, -3120177.457, -123254.85, 462.196, 402.077, 308.458, 1.3023, 3.5694, 0.8414, 8.6398, 'position_vector'], [-3519654.182, -3119815.919, -122906.241]), ('control #14', [-6389654.874, -3984093.2, -3011962.836, 356.165, -201.583, 189.984, 2.6426, 1.938, -0.6636, -3.7122, 'coordinate_frame'], [-6389233.872, -3984339.138, -3011770.663]), ('control #15', [4550537.139, 2792317.331, 1441981.13, 76.583, -265.303, -460.556, -0.538, -4.9358, -3.9263, 0.893, 'coordinate_frame'], [4550599.139, 2792137.381, 1441420.253]), ('control #16', [6034311.204, -4464484.503, 922428.188, 291.409, -257.511, -47.177, 0.8272, -3.8801, -0.5275, 8.0745, 'position_vector'], [6034622.567, -4464797.194, 922484.069])], [('control #12', [2647634.641, -1578921.141, -5093066.149, -355.392, 203.405, 165.947, 0.2987, -4.1705, -3.9905, -0.2744, 'position_vector'], [2647350.953, -1578761.15, -5092847.558]), ('control #13', [-3520096.56, -3120177.457, -123254.85, 462.196, 402.077, 308.458, 1.3023, 3.5694, 0.8414, 8.6398, 'position_vector'], [-3519654.182, -3119815.919, -122906.241]), ('control #14', [-6389654.874, -3984093.2, -3011962.836, 356.165, -201.583, 189.984, 2.6426, 1.938, -0.6636, -3.7122, 'coordinate_frame'], [-6389233.872, -3984339.138, -3011770.663]), ('control #15', [4550537.139, 2792317.331, 1441981.13, 76.583, -265.303, -460.556, -0.538, -4.9358, -3.9263, 0.893, 'coordinate_frame'], [4550599.139, 2792137.381, 1441420.253]), ('control #16', [6034311.204, -4464484.503, 922428.188, 291.409, -257.511, -47.177, 0.8272, -3.8801, -0.5275, 8.0745, 'position_vector'], [6034622.567, -4464797.194, 922484.069]), ('control #17', [5230974.683, -6230904.331, 2167328.689, 237.623, -185.552, -261.576, 1.7677, -1.5195, 4.1454, -3.6432, 'coordinate_frame'], [5231083.99, -6231153.737, 2167074.081]), ('control #18', [-1470319.114, 2740548.116, 5125620.909, 221.777, -218.178, -383.42, 0.9421, 2.6081, 1.1154, -5.3136, 'coordinate_frame'], [-1470139.515, 2740346.737, 5125179.145]), ('control #19', [-529746.466, -5359638.341, -3123219.208, -191.594, -97.844, -141.662, -3.4167, -1.306, 1.572, 1.687, 'position_vector'], [-529878.331, -5359800.999, -3123280.712])]]
for label, args, expected in fixtures[N-1]:
check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control #0 | [-5541265.265, -2232093.171, -6352879.137] | [-5541265.265, -2232093.171, -6352879.137] | Passed |
| control #1 | [-4612646.31, 853774.942, -297090.8] | [-4612646.31, 853774.942, -297090.8] | Passed |
| control #2 | [1975888.355, -227356.269, 2770795.14] | [1975888.355, -227356.269, 2770795.14] | Passed |
| control #3 | [-189556.8, 3352227.961, -2404422.458] | [-189556.8, 3352227.961, -2404422.458] | Passed |
| control #4 | [-6227853.253, -1104735.458, 4388478.796] | [-6227853.253, -1104735.458, 4388478.796] | Passed |
| control #5 | [-2535543.615, -5957404.478, -4097258.353] | [-2535543.615, -5957404.478, -4097258.353] | Passed |
| control #6 | [3628065.687, 5819682.953, -5922196.787] | [3628065.687, 5819682.953, -5922196.787] | Passed |
| control #7 | [-1973541.705, 3874671.113, 5178182.563] | [-1973541.705, 3874671.113, 5178182.563] | Passed |
SHA-256 / 8f24a3c8644bda9148c07a3a004670634e8f1e2537a8d1697a2b88497109bac2
Verification & scope
Stipulated deterministic toy contract on a bounded input domain; results are rounded as stated and no conformance with any published standard or library is claimed. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:48:19.793160+00:00.
Case digest / 6e99205a22c1e947e2479db817a3d96bb3d63e9abbefa09272bd837e2e8dcb62