1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-07 07:13:21 +02:00
GPXSee/src/map/angularunits.h

32 lines
725 B
C
Raw Normal View History

#ifndef ANGULARUNITS_H
#define ANGULARUNITS_H
#include <cmath>
#include <QDebug>
class AngularUnits
{
public:
AngularUnits() : _f(NAN) {}
AngularUnits(int code);
bool isNull() const {return std::isnan(_f);}
bool isValid() const {return !std::isnan(_f);}
double toDegrees(double val) const {return val * _f;}
double fromDegrees(double val) const {return val / _f;}
friend bool operator==(const AngularUnits &au1, const AngularUnits &au2);
friend QDebug operator<<(QDebug dbg, const AngularUnits &au);
private:
double _f;
};
inline bool operator==(const AngularUnits &au1, const AngularUnits &au2)
{return (au1._f == au2._f);}
QDebug operator<<(QDebug dbg, const AngularUnits &au);
#endif // ANGULARUNITS_H