aboutsummaryrefslogtreecommitdiffstats
path: root/labs/include/point.hpp
blob: 95458df31091d3b8c9f2b86f5904fa02d15e3de9 (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
31
32
33
34
35
#ifndef POINT_HPP
#define POINT_HPP

#include <string>
#include <sstream>
#include <cmath>

class Point {
public:
    Point() : x(0), y(0), distance(0) {}
    Point(double x, double y);

    void set(double x, double y);
    void set_x(double x);
    void set_y(double y);
    void origin_symmetry();
    void translate(Point p);

    double get_x();
    double get_y();
    double get_distance();
    double get_distance(Point p);

    std::string str();
    
protected:
private:
    double x;
    double y;
    double distance;

    void calc_distance();
};

#endif