-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPoint.h
30 lines (28 loc) · 878 Bytes
/
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
#pragma once
#include <SFML\Graphics.hpp>
/**------------------------------------------------------------
2D-vector and basic operations: +, +=, -, -=, ==,
Also scalar multiplication (postfix only) and *= C.
Special functions: module, clockwise 90* turn
and unit vector given angle.
Void constuctor gives (0, 0) point.
-----------------------------------------------------------*/
struct Point
{
double x;
double y;
Point();
Point(double x, double y);
Point(double alpha);
Point T() const;
double module() const;
Point operator+(const Point &other) const;
Point operator-(const Point &other) const;
Point operator-() const;
bool operator==(const Point &other) const;
Point& operator+=(const Point &other);
Point& operator-=(const Point &other);
Point operator*(const double C) const;
Point& operator*=(const double C);
sf::Vector2f vector();
};