23 , _lon0(6 * zone - 183)
25 , _falsenorthing(northp ? 0 : 100e5) {
26 if (!(zone >= 1 && zone <= 60))
30 _tm.
Forward(_lon0, lat, lon, x, y);
37 _tm.
Reverse(_lon0, x, y, lat, lon);
43 UTMalt tm(6378388, 1/297.0, 30,
true);
46 double lat = 40.4,
lon = -3.7;
49 cout << fixed << setprecision(0) << x <<
" " << y <<
"\n";
53 double x = 441e3,
y = 4472e3;
56 cout << fixed << setprecision(5) << lat <<
" " << lon <<
"\n";
59 catch (
const exception&
e) {
60 cerr <<
"Caught exception: " << e.what() <<
"\n";
Transverse Mercator projection.
void Reverse(double x, double y, double &lat, double &lon)
Header for GeographicLib::TransverseMercator class.
void Forward(double lat, double lon, double &x, double &y)
void Forward(real lon0, real lat, real lon, real &x, real &y, real &gamma, real &k) const
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Namespace for GeographicLib.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Constants needed by GeographicLib
Exception handling for GeographicLib.
UTMalt(double a, double f, int zone, bool northp)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
void Reverse(real lon0, real x, real y, real &lat, real &lon, real &gamma, real &k) const