geoprimsField-grade geospatial math

Site localization (calibration)

Fits local site coordinates to grid coordinates through control points seen in both, by a similarity (scale, rotation, shift) or affine transform, with residuals, their root mean square, and a check for a feet-and-meters mix-up.

Experimental: not yet fully verified. How results are checked

0.999968514

The fit has a scale of 0.999968514, and its residuals average 0.0013 m (root mean square).

Residuals
PointNorthing residualEasting residualHorizontal residual
CP10.0007 m-0.0009 m0.0011 m
CP2-0.0005 m0.0008 m0.0010 m
CP30.0008 m-0.0012 m0.0014 m
CP4-0.0010 m0.0013 m0.0016 m
Scale offset
Rotation
Root-mean-square residual
Northing shift
Easting shift
a
Provenance
Computed by
survey.gnss.localization 1.0.0, core 0.1.0
Model
Least squares on centroid-reduced coordinates. Similarity: E = a·e + b·n + tE, N = c·e + d·n + tN with d = a and b = −c, scale √(a² + c²), rotation atan2(c, a). Affine: E = a·e + b·n + tE, N = c·e + d·n + tN, scale √|ad − bc|. Local and grid values are compared in meters
Accuracy
Exact least squares; the transform is only as good as the control points and holds within their extent
Notes
1 shown with the answer
Cites
Ghilani, C. D., and Wolf, P. R., Pearson, Elementary Surveying: An Introduction to Geomatics

Something look off?

Your values

Showing an example. Change anything.
Run many at once from a CSV

Loading…

How we got thisFormula, worked example, sources, and proof

Model: Least squares on centroid-reduced coordinates. Similarity: E = a·e + b·n + tE, N = c·e + d·n + tN with d = a and b = −c, scale √(a² + c²), rotation atan2(c, a). Affine: E = a·e + b·n + tE, N = c·e + d·n + tN, scale √|ad − bc|. Local and grid values are compared in meters

Show your work

  1. Rotation

    atan2(c, a) from the least-squares coefficients

    a = 0.999625908, c = 0.02617389 = 1.499872°

  2. Scale

    (a2+c2)

    a = 0.999625908, c = 0.02617389 = 0.999968514

The same steps an agent gets from the MCP server with explain: true.

Accuracy: Exact least squares; the transform is only as good as the control points and holds within their extent

Worked example: Four control points, similarity. Source: Built at scale 0.99997 and 1.5° rotation with a few millimeters of noise; least squares after Ghilani and Wolf (2021).

You enter

Expected combined factor
0.99997
Control points
CP1, 5000 ft, 5000 ft, 1520129.021 ft, 3139867.253 ft CP2, 6000 ft, 5200 ft, 1521133.878 ft, 3140041.010 ft CP3, 5400 ft, 6100 ft, 1520557.663 ft, 3140956.371 ft CP4, 4700 ft, 5800 ft, 1519850.067 ft, 3140674.813 ft

You get

Scale
0.999968514
Scale offset
-31.5
Rotation
1.499872°
Root-mean-square residual
0.0013 m
Northing shift
461,772.006 m
Easting shift
955,547.9987 m
a
0.999625907781
b
-0.02617389049
c
0.02617389049
d
0.999625907781
Transform
similarity

Review: Not yet independently reviewed by a licensed surveyor.

Last verified: 2026-09-23, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.

Status: version 1.0.0, core 0.1.0. See this tool in the verification report.

Changes

Checked against: 7 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.

Sources

Experimental means this tool has not yet met the stable bar: at least 20 golden vectors, differential tests, and an independent worked example.