-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraham.h
More file actions
42 lines (37 loc) · 664 Bytes
/
Graham.h
File metadata and controls
42 lines (37 loc) · 664 Bytes
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
#ifndef GRAHAM_H
#define GRAHAM_H
#include <string>
#include "TimeStruct.h"
namespace algo
{
struct Point
{
float x, y;
float angle = 0.0;
int index;
Point() {}
Point(int index, float x, float y)
{
this->index = index;
this->x = x;
this->y = y;
}
Point operator -(Point a)
{
Point result;
result.x = this->x - a.x;
result.y = this->y - a.y;
return result;
}
};
struct PointArray
{
Point* array;
int length;
};
PointArray* ReadPointsFromFile(std::string path);
float VectorProduct(Point a, Point b);
int CompareAngles(Point x, Point y);
LL<Point> *Graham(PointArray* pointsArray, timeStruct* ts);
}
#endif