1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-24 23:44:25 +02:00

Added support for Transversal Mercator projection

This commit is contained in:
2017-03-29 00:17:47 +02:00
parent b3dc886afc
commit b3e8081942
13 changed files with 244 additions and 35 deletions

13
src/mercator.cpp Normal file
View File

@ -0,0 +1,13 @@
#include <cmath>
#include "rd.h"
#include "mercator.h"
QPointF Mercator::ll2xy(const Coordinates &c) const
{
return QPointF(c.lon(), rad2deg(log(tan(M_PI/4.0 + deg2rad(c.lat())/2.0))));
}
Coordinates Mercator::xy2ll(const QPointF &p) const
{
return Coordinates(p.x(), rad2deg(2 * atan(exp(deg2rad(p.y()))) - M_PI/2));
}