Having worked some time with GPS-coordinates, I started thinking "what do longitude and latitude really represent?". I mean, some kind of idealized model of the earth must obviously be used, and I was pretty sure it wasn't simply a sphere. Using a sphere would make the concept of longitude and latitude fairly trivial, but it's not a sphere, it's an ellipsoid. And in that case, at least for me, there are several possible answers, at least in the case of latitude. I ended up doing some research and this is what I found out.

Let us start with longitude, since this is the easiest to define. Consider first the plane on which the equator lies. Denote the center of the earth point

C (which also lies on this plane). Project now the position of the Royal Greenwich Observatory, Greenwich, England, perpendicularly onto this plane and denote it point

G. Finally we take the position, not necessarily at sea level, for which we wish to find the longitude and also project it perpendicularly onto the plane. We denote it

P. The angle ρ between the line segments

CG and

CP is now the longitude.

Some details should be noted. First of all, the positive direction of the angle is anti-clockwise when considering the equatorial plane from the north pole. Secondly, we require -π ≤ ρ ≤ π. Of course, degrees are normally used and a 'W' or 'E' is used instead of negative and positive numbers.

What makes longitudes easy to handle is due to the fact that every that every plane cut through the earth, which is parallel to the equatorial plane, makes a cut through the earth's surface which is a perfect circle. This is of course not the case in the "real world", but it is the case for the reference model that is used for modelling the sea level of the earth.

Let us now turn to the real subject, namely latitude. For that we need to take a closer look at the reference model mentioned above. If we make a plane cut through the earth with both the north and south pole lying on this plane, we get an ellipse.

We will denote the semi-major axis (half the largest "diameter")

a and the semi-minor axis (half the smallest "diameter")

b. According to the

WGS 84 standard (the reference model currently used for GPS devices) we have

a = 6378137 m

f = 1 - a/b = 1/298.257223563

where

f is the so-called flattening, leading to

b ≈ 6356752.3 m.

Let us now consider the following Cartesian coordinate system. The origo is at the center of the earth, the first axis, the

r-axis, lies in the equatorial plane and the second axis, the

Z-axis, goes in the direction of the north pole. We ignore longitude for the moment, since this is simple rotation about the south-north pole axis, which we can apply afterwards.

The reference ellipse above is easily represented by

r = a cos θ

Z = b sin θ

So is θ simply latitude? No, although it is sometimes called reduced or parametric latitude.

Let us denote the actual angle between the equatorial plane and the line from the center of the earth to the point in question by σ. The relation between σ and θ is easily seen to be

tan σ = (1-f) tan θ

So is σ latitude? No, but it is sometimes called geocentric latitude.

Let us turn to "real" latitude, then. It is commonly called geodetic or atronomical latitude. Imagine standing on the earth's surface, looking in the direction of north. Image furthermore that you can see a star located directly on the line of the poles (Polaris is a good choice). The angle between the direction of the horizon and the direction of the north star is latitude.

In the reference model we do the following. We imagine making a plane cut through the reference ellipsoid containing the position in question and both the north and south pole. In this plane we have our (

r,

Z)-coordinate system. Let the position be at the earth's surface (or rather, on the surface of the reference ellipsoid) and call it

P. If the parametric latitude is θ we see that the direction of the tangent at

P is (-

a sin θ,

b cos θ), so the relation between the geodesic latitude λ and θ is

tan λ = tan θ / (1-f)

Now given geodesic latitude λ we have the position at the earth's surface (in our longitude-plane) as

r =

a cos θ

Z =

b sin θ

where θ = arctan((1-

f) tan λ).

We can rewrite this so we get rid of θ using

cos(arctan(v)) = 1/sqrt(v^{2} + 1)

sin(arctan(v)) = v/sqrt(v^{2} + 1)

leading to

r = a K cos λ

Z = b (1-f) K sin λ = a (1-f)^{2} K sin λ

where K = 1/sqrt((1-f)^{2} sin^{2} λ + cos^{2} λ).

But apart from longitude and latitude there is also height h. Height is to be measured perpendicularly to the tangent plane so our actual position

P has the coordinates

r = r + h cos(λ) = (a K + h) cos(λ)

Z = Z + h sin(λ) = (a (1-f)^{2} K + h) sin(λ)

where K = 1/sqrt((1-f)^{2} sin^{2} λ + cos^{2} λ).

Let us finally collect all the threads. Consider the 3-dimensinal Cartesian coordinate system with origo at the center of the earth, the

X-axis lying in the equatorial plane and pointing in the direction of the Greenwich observatory, the

Z-axis pointing towards the north pole and the

Y-axis completing the coordinate system such that a right-handed orthogonal coordinate system is created. Given longitude ρ, (geodesic) latitude λ and height h, we get

X = r cos(ρ) = (a K + h) cos(λ) cos(ρ)

Y = r sin(ρ) = (a K + h) cos(λ) sin(ρ)

Z = (a (1-f)^{2} K + h) sin(λ)

where K = 1/sqrt((1-f)^{2} sin^{2} λ + cos^{2} λ).

Left are some interesting questions. Given

X,

Y and

Z, how do we find longitude, latitude and height? This is actually not a simple problem (see this

drawing). Another question is how do we calculate the distance between two positions, following the curvature of the earth (and not the Euclidian distance)? Maybe I will get back to these questions in later posts.

Some links:

The Global Positioning SystemSpheroid Geometry