Website Summary Files Commits Branches @commit @diff @stats
path: root / Classes / Triangle / point.hpp
diff options
context:
space:
mode:
Commit6c65d989605d8752b92be00ad8c12e56ea75e0be (patch)
Author
 Angeld55 <achi_d@abv.bg>
2019-09-20 14:41:49 +0300
Committer
 GitHub <noreply@github.com>
2019-09-20 14:41:49 +0300
Files9c60d606bebd1ac84f378f6019ead4a0e914dd34 /Classes/Triangle/point.hpp
Object-oriented_programming_FMI-6c65d989605d8752b92be00ad8c12e56ea75e0be.tar
Object-oriented_programming_FMI-6c65d989605d8752b92be00ad8c12e56ea75e0be.tar.gz
Object-oriented_programming_FMI-6c65d989605d8752b92be00ad8c12e56ea75e0be.zip
Parent571baddb7dbeb81284da72dd0feadc639f1a40cc (diff)
Add files via upload
1 files changed, 23 insertions, 0 deletions
-rw-r--r--Classes/Triangle/point.hpp23
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 <iostream>
+
+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