This isn't a complete patch, but based on some math I
I have determined that making these changes to
tmerc.cpp lets me use a nonzero origin latitude when
converting from TM (in my case, Illinois East State
Plane) to geo:
for (int coordIdx=0; coordIdx<count;
x = xy - x0;
y = xy - y0;
| M0 = a*(A0*lat0-A2*sin(2*lat0)+
| M = M0 + y / k0;
// This is how Chuck calculated phi1.
phi1 = mu + (3*e1/2-27*e1*e1*e1/32)*sin(2*mu)
In my case, I set lat0 to a constant, but presumably
one could add command-line options to make the solution
more general. I see that the same site has the inverse
math, but since I only needed to do the TM->Geo
conversion, I didn't investigate further.
Thanks for the great program; it made my job of
converting some Chicago transit maps much easier.