geoprimsField-grade geospatial math

ECEF to local frame rotation matrix

The 3 × 3 rotation matrix that turns Earth-centered () vector components into east-north-up or north-east-down components at a latitude and longitude.

(0.432884, -0.3763, 0.819152); (-0.656059, -0.75471, 0); (0.618222, -0.537412, -0.573576)

The matrix is (0.432884, -0.3763, 0.819152); (-0.656059, -0.75471, 0); (0.618222, -0.537412, -0.573576). Each row is one local axis in X, Y, and Z.

Rotation ECEF → ENU
XYZ
0.432883631504-0.3762999998840.819152044289
-0.656059028991-0.7547095802230.000000000000
0.618221895484-0.537412094772-0.573576436351
Provenance
Computed by
geodesy.frame.local-rotation-matrix 1.0.0, core 0.1.0
Model
Rows of the ECEF-to-ENU matrix at latitude φ and longitude λ: east (−sin λ, cos λ, 0), north (−sin φ cos λ, −sin φ sin λ, cos φ), up (cos φ cos λ, cos φ sin λ, sin φ); NED takes the rows north, east, and minus up
Accuracy
Exact trigonometry; the matrix is orthonormal to rounding
Notes
None
Cites
Karney, C. F. F., GeographicLib, GeographicLib Geocentric and LocalCartesian classes

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: Rows of the ECEF-to-ENU matrix at latitude φ and longitude λ: east (−sin λ, cos λ, 0), north (−sin φ cos λ, −sin φ sin λ, cos φ), up (cos φ cos λ, cos φ sin λ, sin φ); NED takes the rows north, east, and minus up

Accuracy: Exact trigonometry; the matrix is orthonormal to rounding

When to use this: Use this to rotate a vector, not a position, from Earth-centered axes into local ones: a GNSS velocity, a baseline between two receivers, a covariance, or a line-of-sight unit vector. Enter the latitude and longitude where the local frame sits and choose east-north-up or north-east-down. Multiply the matrix by the ECEF vector to get its local components; its transpose rotates back.

Limitations: A rotation acts on differences and directions. To convert a position, subtract the origin's ECEF coordinates first, or use the point-to-local-frame tool, which does both steps. The latitude is geodetic, so the up row is the ellipsoid's normal, not the direction from the Earth's center. At the poles east and north depend on the longitude entered.

Worked example: The north-east-down frame at 35° N, 139° E. Source: Direction cosines of the local axes in ECEF. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.

You enter

Local frame
ned
Origin latitude
35 deg
Origin longitude
139 deg

You get

Rotation matrix
(0.432884, -0.3763, 0.819152); (-0.656059, -0.75471, 0); (0.618222, -0.537412, -0.573576)

Review: Not yet independently reviewed by a geodesist.

Last verified: 2026-09-18, 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: 23 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.

Sources

Terms

ECEF: Earth-centered, Earth-fixed
Cartesian X, Y, Z coordinates in meters from Earth's center, turning with the Earth. X points to 0° longitude on the equator and Z to the North Pole. Source: Department of Defense World Geodetic System 1984
ENU: east, north, up
Local Cartesian coordinates centered on a chosen point, with axes toward east, north, and up. Source: GeographicLib

ECEF — Earth-centered, Earth-fixed

Cartesian X, Y, Z coordinates in meters from Earth's center, turning with the Earth. X points to 0° longitude on the equator and Z to the North Pole.

Source: Department of Defense World Geodetic System 1984