Note: This document is available in PDF.

## Introduction

Coordinate conversion between Universal Transverse Mercator (UTM) and geographic coordinates is a very common problem when working with Geographic Information Systems.

This document is an English translation of a publication that is in Spanish [1] [2]. I use that method for coding my own program to convert coordinates.

There are some procedures to perform the conversion between geographic coordinates and UTM.

• UTM Projection tables, from Servicio Geográfico del Ejército de España (SGE), Sección de Geodesia (1976): Proyección Universal Tranversa Mercator, SGE, Madrid. Vol. I: Sistemas conformes. Proyección U.T.M. Cuadrículas y Sistemas de referencia, (220 pp.); Vol. II: Tablas, (331 pp.).
• US Army direct formulas for transformation, published in 1973 (USGS Bolletin No. 1532).
• Coticchia-Surace formulas, from “Bolletino di Geodesia a Science Affini” No. 1.

This document is using the third method which is the easiest to code in a computer program. This procedure gets centimeter precision in the conversion if using enough decimal places, so floating point or double variables should be used.

## Conversion from geographic coordinates to UTM

First we get a pair of geodesic geographic coordinates and the basic data of Hayford ellipsoid (as an example but you can use other ellipsoid), such as semi-major axis $$(a)$$ and semi-minor axis $$(b)$$.

a = 6,378,388.0 \quad
b = 6,356,911.94613

With this data we can start the operations.

### Previous calculations

#### Ellipsoid geometry

We start to calculate the eccentricity, second eccentricity, polar radius of curvature and flattening. Eccentricity ((e)) and second eccentricity ((e’)) are given by:

e = \frac{\sqrt{a^2 – b^2}}{a}

e’ = \frac{\sqrt{a^2 – b^2}}{b}

The square of the second eccentricity is a very useful number in the operations so make sure to save it somewhere. The polar radius of curvature ((c)) and flattening ((\alpha)) are given by:

c = \frac{a^2}{b}

\alpha = \frac{a-b}{a}

Actually the flattening and eccentricity aren’t necessary for the Coticchia-Surace equations, but they are frequent parameters of the ellipsoid that sometimes are given as a pair of data ((a)) and ((\alpha)); and sometimes as ((a)) and ((e)). Under those circumstances one can calculate ((b)) if the corresponding equations are known.

#### Latitude and longitude

First, sexagesimal degrees (or degrees, minutes and seconds represented as ((DD), (MM) and (SS)) have to be converted to decimal notation.

dec = DD + \frac{MM}{60} + \frac{SS}{3600}

Once we have latitude ((\varphi)) and longitude ((\lambda)) in decimal notation, they have to be converted to radians. The operation is as follow

rad = \frac{dec \cdot \pi}{180}

Next, the longitude sign should be determined. This is as simple as

sign \left{ \begin{array}{l}
\text{If West, then negative (-)} \
\text{If East, then positive (+)}
\end{array} \right.

West and East are the longitude referenced from the Greenwich meridian.

#### Time zone

Once we have longitude and latitude ready, the time zone or UTM zone where the coordinates are located can be obtained.

zone = int \left[\frac{dec}{6} + 31\right]

Where (int) represent only the integer part of the obtained value.

Next step is to get the central meridian of such time zone.

\lambda_0 = zone \cdot 6 – 183

Following we have to calculate the distance between the longitude of our original coordinates and the central meridian. Its important to notice that this operations have to be done in radians, so the central meridian just obtained have to be converted first. The original longitude is already in radians.

\Delta \lambda = \lambda – \lambda_0

### Coticchia-Surace equations

In this section the Coticchia-Surace equations for the direct problem of converting geodesic geographic coordinates to UTM are presented.

#### Parameter calculation

A set of serial parameters should be calculated. There are a lot of equations but they are sequential and easy to code.

A = \cos \varphi \cdot \sin \Delta \lambda

\xi = \frac{1}{2} \cdot \ln \left[ \frac{1+A}{1-A} \right]

\eta = \arctan \left( \frac{\tan \varphi}{cos \Delta \lambda} \right) – \varphi

\nu = \frac{c}{(1 + e’^2 \cdot \cos^2 \varphi)^\frac{1}{2}} \cdot 0.9996

where (0.9996) is the scale factor for the UTM projection.

\zeta = \frac{e’^2}{2} \cdot \xi^2 \cdot \cos^2 \varphi

A_1 = \sin (2 \cdot \varphi)

A_2 = A_1 \cdot \cos^2 \varphi

J_2 = \varphi + \frac{A_1}{2}

J_4 = \frac{3 \cdot J_2 + A_2}{4}

J_6 = \frac{5 \cdot J_4 + A_2 \cos^2 \varphi}{3}

\alpha = \frac{3}{4} \cdot e’^2

\beta = \frac{5}{3} \cdot \alpha^2

\gamma = \frac{35}{27} \cdot \alpha^3

B_\phi = 0.9996 \cdot c \cdot (\varphi – \alpha J_2 + \beta J_4 – \gamma J_6)

Final calculation of coordinates
Once we have all the parameters the final coordinates in UTM is obtained as follow

X = \xi \cdot \nu \cdot \left( 1 + \frac{\zeta}{3} \right) + 500,000

For the (Y) solution is important to remember if the latitude of the geodesic geographic coordinates belongs to the southern hemisphere, we should add the value of (10,000,000) to the result. In the case of northern hemisphere we have nothing to add.

Y = \eta \cdot \nu \cdot \left( 1 + \zeta \right) + B_\phi

## Conversion from UTM to geographic coordinates

We are going to start by using a pair of UTM coordinates and their respective zone. Also we are going to need the basic data of Hayford ellipsoid (as an example but you can use another ellipsoid), such as semi-major axis ((a)) and semi-minor axis ((b)).

a = 6,378,388.0 \quad
b = 6,356,911.94613

With this data we can start the operations. The ellipsoid geometry calculations are exactly the same as the previous section, the parameter calculations are very similar.

### Previous calculations

#### Ellipsoid geometry

We start to calculate the eccentricity, second eccentricity, polar radius of curvature and flattening. Eccentricity ((e)) and second eccentricity ((e’)) are given by:

e = \frac{\sqrt{a^2 – b^2}}{a}

e’ = \frac{\sqrt{a^2 – b^2}}{b}

The square of the second eccentricity is a very useful number in the operations so make sure to save it somewhere. The polar radius of curvature ((c)) and flattening ((\alpha)) are given by:

c = \frac{a^2}{b}

\alpha = \frac{a-b}{a}

Actually the flattening and eccentricity aren’t necessary for the Coticchia-Surace equations, but they are frequent parameters of the ellipsoid that sometimes are given as a pair of data ((a)) and ((\alpha)); and sometimes as ((a)) and ((e)). Under those circumstances one can calculate ((b)) if the corresponding equations are known.

Previous calculations of (X, Y) coordinates
We start by modifying the X coordinate

X = X – 500,000

For the Y coordinate we should modify it only when it is on the southern hemisphere

sign \left{ \begin{array}{l}
\text{If Northern, then not modify Y} \
\text{If Southern, then Y = Y – 10,000,000}
\end{array} \right.

Central meridian of the time zone
The UTM zone of the X,Y coordinates to convert should be known as another parameter in the conversion. This operation is similar to the inverse conversion

\lambda_0 = zone \cdot 6 – 183

### Coticchia-Surace equations

#### Parameter calculations

Most of the parameters are calculated in a similar way or even equal to the previous problem

\varphi’ = \frac{Y}{6,366,197.724 \cdot 0.9996}

\nu = \frac{c}{(1 + e’^2 \cdot \cos^2 \varphi’)^\frac{1}{2}} \cdot 0.9996

a = \frac{X}{\nu}

A_1 = \sin (2 \cdot \varphi’)

A_2 = A_1 \cdot \cos^2 \varphi’

J_2 = \varphi’ + \frac{A_1}{2}

J_4 = \frac{3 \cdot J_4 + A_2}{4}

J_6 = \frac{5 \cdot J_4 + A_2 \cdot \cos^2 \varphi’}{3}

\alpha = \frac{3}{4} \cdot e’^2

\beta = \frac{5}{4} \cdot \alpha^2

\gamma = \frac{35}{27} \cdot \alpha^3

B_\phi = 0.9996 \cdot c \cdot \left( \varphi’ – \alpha \cdot J_2 + \beta \cdot J_4 – \gamma \cdot J_6 \right)

b = \frac{Y – B_\phi}{\nu}

\zeta = \frac{e’^2 \cdot a^2}{2} \cdot \cos^2 \varphi’

\xi = a \cdot \left[ 1 – \frac{\zeta}{3} \right]

\eta = b \cdot (1 – \zeta) + \varphi’

\sin h \xi = \frac{\exp^\xi – \exp^{-\xi}}{2}

\Delta \lambda = \arctan \frac{\sin h \xi}{\cos \eta}

\tau = \arctan (\cos \Delta \lambda \cdot \tan \eta)

### Final calculation of coordinates

The longitude composition is very simple. We have to take care of performing this operation in degrees expressed in decimal notation, so (\Delta \lambda) has to be divided by (\pi) and multiplied by (180). (\lambda_0) is already in decimal degrees
\lambda = \Delta \lambda + \lambda_0

The latitude calculation is a little more complicated:

\begin{array}{l l}
\varphi = & \varphi’ + \left[ 1 + e’^2 \cdot \cos^2 \varphi’ -\frac{3}{2} \cdot e’^2 \cdot \sin \varphi’ \cdot \right. \
& \left. \cos \varphi’ \cdot (\tau – \varphi’) \right] \cdot (\tau – \varphi’)
\end{array}

Now we have to convert the latitude from radians to degrees expressed in decimal notation

dec = \frac{\varphi (\text{in radians)}}{\pi} \cdot 180

Once we have latitude and longitude in degrees expressed in decimal notation, we have to convert the result to sexagesimal notation in degrees, minutes and seconds ((DD, MM, SS)). For the degrees we operate both latitude and longitude as follow

DD = int[dec]

where (int) is the integer part of the value. Then minutes

MM = int[(dec – DD) \cdot 60]

again (int) is the integer part of the value. Finally, seconds

SS = ((dec – DD) \cdot 60 – MM) \cdot 60

If longitude result with negative sign then the value its at west of Greenwich meridian.