-
Notifications
You must be signed in to change notification settings - Fork 0
/
point.h
59 lines (34 loc) · 1.08 KB
/
point.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
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef INC_POINT_H
#define INC_POINT_H
class point {
public:
double x, y;
point &operator-=(const point &a);
point &operator-=(const double &a);
point &operator+=(const point &a);
point &operator+=(const double &a);
const point operator+(const point &p) const;
const point operator-(const point &p) const;
point &operator*=(const double &k);
const point operator*(const double &d) const;
point &operator/=(const point &p);
point &operator/=(const double &d);
const point operator/(const double &d) const;
point operator-();
point(double cx, double cy);
point();
void Norm();
double Length();
void Rotate();
};
point Point(double x, double y);
double sqr(double n);
double Angle(point t);
double Angle(point a, point b);
double Length(point a, point b);
double DistancePointToLine(point p, point a, point b);
double CosBetween(point a, point b);
double GetProgress(point p, point a, point b);
bool OnRight(point p, point a, point b);
bool PointProjectionInsideSegment(point p, point a, point b);
#endif