Code:
Note: These formulas have been transcribed from EPSG Guidance Note #7-2. Users a
re encouraged to use that document rather than the text which follows as referen
ce because limitations in the transcription will be avoided.
The formulas to derive the projected Easting and Northing coordinates are in the
form of a series as follows:
Easting, E = FE + k0*nu[A + (1 - T + C)A^3/6 + (5 - 18T + T^2 + 72C - 58e'sq)A^
5/120]
Northing, N = FN + k0{M - M0 + nu*tan(lat)[A^2/2 + (5 - T + 9C + 4C^2)A^4/24 +
(61 - 58T + T^2 + 600C - 330e'sq)A^6/720]}
where T = tan^2(lat)
nu = a /(1 - esq*sin^2(lat))^0.5
C = esq*cos^2(lat)/(1 - esq)
A = (lon - lon0)cos(lat), with lon and lon0 in radians.
M = a[(1 - esq/4 - 3e^4/64 - 5e^6/256 -....)lat - (3esq/8 + 3e^4/32 + 45e^6/1024
+....)sin(2*lat) + (15e^4/256 + 45e^6/1024 +.....)sin(4*lat) - (35e^6/3072 + ...
.)sin(6*lat) + .....]
with lat in radians and M0 for lat0, the latitude of the origin, derived in the
same way.
The reverse formulas to convert Easting and Northing projected coordinates to la
titude and longitude are:
lat = lat1 - (nu1*tan(lat1)/rho1)[D^2/2 - (5 + 3*T1 + 10*C1 - 4*C1^2 - 9*e'^2)D^
4/24 + (61 + 90*T1 + 298*C1 + 45*T1^2 - 252*e'^2 - 3*C1^2)D^6/720]
lon = lon0 + [D - (1 + 2*T1 + C1)D^3/6 + (5 - 2*C1 + 28*T1 - 3*C1^2 + 8*e'^2 + 2
4*T1^2)D^5/120] / cos(lat1)
where lat1 may be found as for the Cassini projection from:
lat1 = mu1 + ((3*e1)/2 - 27*e1^3/32 +.....)sin(2*mu1) + (21*e1^2/16 -55*e1^4/32
+ ....)sin(4*mu1)+ (151*e1^3/96 +.....)sin(6*mu1) + (1097*e1^4/512 - ....)sin(8*
mu1) + ......
and where
nu1 = a /(1 - esq*sin^2(lat1))^0.5
rho1 = a(1 - esq)/(1 - esq*sin^2(lat1))^1.5
e1 = [1- (1 - esq)^0.5]/[1 + (1 - esq)^0.5]
mu1 = M1/[a(1 - esq/4 - 3e^4/64 - 5e^6/256 - ....)]
M1 = M0 + (N - FN)/k0
T1 = tan^2(lat1)
C1 = e'^2*cos^2(lat1)
D = (E - FE)/(nu1*k0), with nu1 = nu for lat1
For areas south of the equator the value of latitude lat will be negative and th
e formulas above, to compute the E and N, will automatically result in the corr
ect values. Note that the false northings of the origin, if the equator, will ne
ed to be large to avoid negative northings and for the UTM projection is in fact
10,000,000m. Alternatively, as in the case of Argentina's Transverse Mercator (
Gauss-Kruger) zones, the origin is at the south pole with a northings of zero. H
owever each zone central meridian takes a false easting of 500000m prefixed by a
n identifying zone number. This ensures that instead of points in
different zones having the same eastings, every point in the country, irrespecti
ve of its projection zone, will have a unique set of projected system coordinate
s. Strict application of the above formulas, with south latitudes negative, will
result in the derivation of the correct Eastings and Northings.
Similarly, in applying the reverse formulas to determine a latitude south of the
equator, a negative sign for lat results from a negative lat1 which in turn res
ults from a negative M1.
400000.00 m
False Northings FN
-100000.00 m
PARAMETER["central_meridian",18],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",6500000],
PARAMETER["false_northing",0],
AUTHORITY["EPSG","31266"],
AXIS["X",EAST],
AXIS["Y",NORTH]]