scatter 0.1.0
Point.hpp
1/*
2 * Copyright (C) Tobias Löw (tobi.loew@protonmail.ch)
3 *
4 * This file is part of Scatter
5 *
6 * Scatter is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Scatter is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Scatter. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22namespace scatter
23{
28 class Point
29 {
30 public:
38 Point(const double &x, const double &y);
39
46 const double &x() const;
47
54 const double &y() const;
55
63 Point operator-(const Point &point) const;
64
72 Point operator+(const Point &point) const;
73
81 Point operator*(const double &multiplier) const;
82
90 Point operator/(const double &value) const;
91
92 private:
94 double x_;
96 double y_;
97 };
98
108 Point operator*(const double &multiplier, const Point &point);
109
110} // namespace scatter
[brief description]
Definition Point.hpp:29
Point operator/(const double &value) const
divide this Point by the given value
const double & x() const
return the x value
Point operator*(const double &multiplier) const
multiply this Point by the given value
const double & y() const
return the y value
Point operator+(const Point &point) const
add another Point
Point(const double &x, const double &y)
constructor
Point operator-(const Point &point) const
substract another Point