blob: 8163f8f15f53d4cfe202810fee5587cc8a2377fc (
plain)
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
|
//
// Created by saintruler on 11.04.19.
//
#ifndef OPENGLTEST_POINT_H
#define OPENGLTEST_POINT_H
#include <cmath>
class Point
{
public:
Point(double x, double y);
friend Point operator+(const Point& left, const Point& right);
friend Point operator+=(Point& left, const Point& right);
friend Point operator-(const Point& left, const Point& right);
friend Point operator-=(Point& left, double right);
friend Point operator/(const Point& left, double right);
friend Point operator/=(Point& left, double right);
friend Point operator*(const Point& left, double right);
friend Point operator*=(Point& left, double right);
double length();
double length_squared();
void normalize();
double x, y;
};
#endif //OPENGLTEST_POINT_H
|