Copyright © 2024 Jiri Kriz,

Earth Coordinates

Cartesian Coordinate System

Spherical Coordinates

The usual cartesian coordinate system associated with the Earth is specified as follows:

Each point on the Earth is uniquely defined by its cartesian coordinates (x, y, z). In fact, only 2 coordinates would suffice because each point is on the surface of a sphere:

x2 + y2 + z2 = R2

where R is the Earth's radius, R = 6371.010 km.

Since this cartesian coordinate system is fixed with the Earth, it is call Earth-centered Earth-fixed (ECEF) system.

Spherical Coordinate System

Points on the Earth are usually specified in the spherical coordinate system.

Spherical Coordinates

The spherical coordinates of an arbitrary cartesian point P(x, y, z) are:

  1. The latitude φ which is the angle between OP and the equator.
  2. The longitude λ which is the angle between the prime meridian and the meridian passing through OP.
  3. The radius r which is the distance of P from the origin.

Since the radius is constant, the two angles (φ, λ) are already sufficient to specify a point on the Earth:

-90° ≤ φ ≤ 90° (Latitude along meridian)
-180° < λ ≤ 180° (Longitude along equator)

The longitude at the poles is arbitrary and is usually set to 0° by convention.

We can easily find the relation between the cartesian and spherical coordinates. Let P(x, y, z) be a cartesian point, and P' its projection on the x/y-plane. The length OP' is

r' = r cos φ

We can now compute the cartesian coordinates from the spherical coordinates:

x = r' cos λ = r cos φ cos λ
y = r' sin λ = r cos φ sin λ
z = r sin φ

Solving these equations for (φ, λ, r) yields the opposite relationship:

r = √ x2 + y2 + z2
φ = arcsin(z/r)
λ = atan2(y, x)

Here, the simple minded λ = arctan(y/x), which is valid only for -90° < λ < 90°, was replaced by the correct atan2(y, x), which yields -180° < λ ≤ 180°.

Geodetic Coordinate System

The spherical coordinate system is closely related to the geodetic system. In the geodetic system, the points are specified by latitude, longitude and elevation (height h). The elevation is measured orthogonal to a reference surface which is usually the earth ellipsoid. When we approximate the earth by a sphere with radius R, then

h = r - R.

ENU Coordinate System

ENU Coordinates

The ENU coordinate system is a local system specific to any point P on the Earth. It is formed from a plane tangent to the Earth's surface at the point P. In this plane:

The practical ENU coordinate system is used e.g. by Google Earth and other targeting and tracking applications.

The vector E = (Ex, Ey, Ez) is tangent to the circle of constant latitude passing through P. This circle is also called a "parallel circle" because it is parallel to the equator. The tangent is obtained by taking partial derivatives of the expressions (4) with respect to λ and normalizing the resulting vector to the length 1:

Ex = - sin λ.
Ey = cos λ.
Ez = 0.

The vector N = (Nx, Ny, Nz) is tangent to the meridian circle passing through P. So, by taking partial derivatives of the expressions (4) with respect to φ and normalizing the resulting vector to the length 1 we get:

Nx = - sin(φ) cos(λ).
Ny = - sin(φ) sin(λ).
Nz = cos(φ).

The unit vector U = (Ux, Uy, Uz) points in the direction of P. So, by setting r = 1 in the expressions (4), we get:

Ux = cos(φ) cos(λ).
Uy = cos(φ) sin(λ).
Uz = sin(φ).

Transforming ENU to ECEF

Let us consider a point Q that has the coordinates (x, y, z) in the ECEF system and coordinates Q' = (e, n, u) in the ENU system located at P = (Px, Py, Pz). The spherical coordinates of P are (φ, λ, R). Then the following equation transforms (e, n, u) to (x, y, z):

x -sin(λ) -sin(φ) cos(λ) cos(φ) cos(λ) e Px
y = cos(λ) -sin(φ) sin(λ) cos(φ) sin(λ) n + Py (10)
z 0 cos(φ) sin(φ) u Pz

Notice that the columns of the transformation matrix M are equal to the vectors E, N, U, respectively. Hence, the matrix M is orthonormal. It corresponds to the rotation of the XYZ-System around the origin into the ENU-System (centered at origin). The transformation is built by first rotating the vectors X, Y, Z around the origin into E, N, U, and then translating this system by the vector P into its final position.

The transformation can be written concisely using vector and matrix notation:

Q = M Q' + P

Transforming ECEF to ENU

The transformation from ECEF to ENU is obtained by inverting the transformation (11):

Q' = M-1 (Q - P) = MT (Q - P)

Here we used the fact that the inverse of an orthonormal matrix is equal to the transformed matrix. This equation is in explicit terms as follows:

e -sin(λ) cos(λ) 0 x - Px
n = -sin(φ) cos(λ) -sin(φ) sin(λ) cos(φ) y - Py (13)
u cos(φ) cos(λ) cos(φ) sin(λ) sin(φ) z - Pz

Let me recall that this equation transforms the XYZ-coordinates (x, y, z) of an arbitrary point Q into its ENU-coordinates (e, n, u). The ENU system is located at the point P with XYZ-coordinates (Px, Py, Pz) and XYZ-spherical coordinates (φ, λ, R).

A thoughtful reader surely noticed an asymmetry in the respective transformations (11) and (12), even if they both express rotations and translations. This apparent problem is resolved as follows. The equation (12) can be written as:

Q' = M-1 Q - M-1 P

The meaning is that the ENU system is first rotated around its origin at P by the inverse rotation such that its axes are parallel to the XYZ-system. Afterwards it is translated by the vector M-1 P such that its origin is moved to the origin O of the XYZ-system. Indeed, the expression M-1 P denotes the origin O = (0, 0, 0)T of the XYZ-system expressed in the ENU-system, as we can see by applying the equation (14) to the point O = (0, 0, 0)T:

O' = M-1 O - M-1 P = - M-1 P

So, the equations (12) or (14), respectively, can be written as:

Q' = M-1 Q + O'

which is completely symmetric to the equation (11). For computational purposes the equations (12) (respectively (13)) are preferable.