-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoint.h
More file actions
35 lines (26 loc) · 889 Bytes
/
Copy pathpoint.h
File metadata and controls
35 lines (26 loc) · 889 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
#ifndef POINT_H
#define POINT_H
#include <iostream>
class Point
{
public:
Point(long double _x = 0, long double _y = 0);
long double x, y;
long double angle() const;
long double angleTo(const Point& p) const;
long double length() const;
long double distanceTo(const Point& p) const;
long double distanceTo(const Point& p1, const Point& p2) const;
long double cross(const Point& p) const;
long double dot(const Point& p) const;
int ccw(const Point& b, const Point& c) const;
Point operator+(const Point& p) const;
Point operator-(const Point& p) const;
Point operator*(long double c) const;
bool operator<(const Point& p) const;
bool operator==(const Point& p) const;
bool operator!=(const Point& p) const;
friend std::istream& operator>>(std::istream& is, Point& p);
friend std::ostream& operator<<(std::ostream& os, const Point& p);
};
#endif