-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGPSPos.h
48 lines (37 loc) · 1.25 KB
/
GPSPos.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/////////////////////////////////////////////////////////////////////////
// Author: Jon Bennett ([email protected]) http://jondbennett.com
//
// GPS Navigation calculation object
// NOTE: All distances and displacements are in meters. Uses
// (that it *requires* the NMEA parser library
/////////////////////////////////////////////////////////////////////////
#ifndef CGPSPOS_H
#define CGPSPOS_H
/////////////////////////////////////////////////////////////////////////
// class CGPSPos
/////////////////////////////////////////////////////////////////////////
class CGPSPos
{
protected:
double m_lat, m_lon;
public:
// Structors
CGPSPos();
CGPSPos(double _dLat, double _dLon);
CGPSPos(const CGPSPos &_pos);
CGPSPos &operator=(const CGPSPos &_pos);
bool operator==(const CGPSPos &_pos);
// Accessors
double getLat() const { return m_lat; }
double getLon() const { return m_lon; }
void setLat(double _dLat) { m_lat = _dLat; }
void setLon(double _dLon) { m_lon = _dLon; }
void setPosition(double _dLat, double _dLon);
void getPosition(double *_pdLat, double *_pdLon);
void clear();
// Calculations
double distanceToInMeters(CGPSPos _pos);
double trueHeadingTo(CGPSPos _pos);
bool displaceByMeters(double _dRadial, double _dDistance);
};
#endif