1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-25 04:05:53 +01:00
GPXSee/src/map/latlon.h

24 lines
508 B
C
Raw Normal View History

2017-03-29 22:51:32 +02:00
#ifndef LATLON_H
#define LATLON_H
#include "ct.h"
#include "angularunits.h"
2017-03-29 22:51:32 +02:00
class LatLon : public CT
2017-03-29 22:51:32 +02:00
{
public:
LatLon(const AngularUnits &au) : _au(au) {}
virtual CT *clone() const {return new LatLon(*this);}
virtual PointD ll2xy(const Coordinates &c) const
{return PointD(_au.fromDegrees(c.lon()), _au.fromDegrees(c.lat()));}
virtual Coordinates xy2ll(const PointD &p) const
{return Coordinates(_au.toDegrees(p.x()), _au.toDegrees(p.y()));}
private:
AngularUnits _au;
2017-03-29 22:51:32 +02:00
};
#endif // LATLON_H