Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Triangle.hpp
diff options
context:
space:
mode:
1 files changed, 0 insertions, 21 deletions
-rw-r--r--Polymorphism/Triangle.hpp21
diff --git a/Polymorphism/Triangle.hpp b/Polymorphism/Triangle.hpp
deleted file mode 100644
index 8372464..0000000
--- a/Polymorphism/Triangle.hpp
+++ /dev/null
@@ -1,21 +0,0 @@
-public:
- Triangle(int x1, int y1, int x2, int y2, int x3, int y3) :Figure(3)
- {
- setPoint(0, x1, y1);
- setPoint(1, x2, y2);
- setPoint(2, x3, y3);
- }
- double getSide(int side)
- {
- return getPoint(side).getDistTo(getPoint((side+1)%3));
- }
- double getPer()
- {
- return getSide(0)+getSide(1)+getSide(2);
- }
- double getArea()
- {
- double halfP = getPer()/2;
- return sqrt(halfP * (halfP-getSide(0))*(halfP-getSide(1))*(halfP-getSide(2)));
- }
-}; \ No newline at end of file