-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoordinate.h
More file actions
60 lines (43 loc) · 1.13 KB
/
coordinate.h
File metadata and controls
60 lines (43 loc) · 1.13 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
/**
* File: coordinate.h
* Author: Nikolai
*
* Created on 4. januar 2013, 02:52
*/
#ifndef COORDINATE_H
#define COORDINATE_H
#include <vector>
#include <cstdlib>
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <math.h>
#include "fileRead.h"
using namespace std;
class coordinate {
public:
bool init();
void add(double, double);
void getPos(int, double&, double&);
void printVectors();
double distanceInMeters(double, double, double, double);
int nearestWaypt(int current);
private:
//used for great circle calculations, do not change!
static constexpr double DEG_TO_RAD = 0.017453292519943295769236907684886;
static constexpr double EARTH_RADIUS_IN_METERS = 6372797.560856;
struct waypoint{
double lat, lon;
int next, prev;
bool visited;
string name;
};
vector<waypoint> wpt;
vector<double> tempLat;
vector<double> tempLon;
fileRead fRead;
bool initialised;
double arcInRadians(double, double, double, double);
};
#endif /* COORDINATE_H */