From 6c65d989605d8752b92be00ad8c12e56ea75e0be Mon Sep 17 00:00:00 2001 From: Angeld55 Date: Fri, 20 Sep 2019 14:41:49 +0300 Subject: Add files via upload --- Classes/Triangle/point.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Classes/Triangle/point.hpp (limited to 'Classes/Triangle/point.hpp') diff --git a/Classes/Triangle/point.hpp b/Classes/Triangle/point.hpp new file mode 100644 index 0000000..a8a2c19 --- /dev/null +++ b/Classes/Triangle/point.hpp @@ -0,0 +1,23 @@ +#include + +struct Point +{ + Point() + { + x = 0; + y = 0; + } + Point(int x, int y) + { + this->x = x; + this->y = y; + } + double DistTo(const Point& other) + { + int dx = x - other.x; + int dy = y - other.y; + return sqrt(dx*dx + dy*dy); + } + int x; + int y; +}; \ No newline at end of file -- cgit v1.3.1-23-gd82d