Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 4 insertions, 0 deletions
-rw-r--r--Polymorphism/Figures/Triangle.hpp4
diff --git a/Polymorphism/Figures/Triangle.hpp b/Polymorphism/Figures/Triangle.hpp
index a6599bf..b933060 100644
--- a/Polymorphism/Figures/Triangle.hpp
+++ b/Polymorphism/Figures/Triangle.hpp
@@ -1,3 +1,6 @@
+#include "Figure.hpp"
+class Triangle
+{
public:
Triangle(int x1, int y1, int x2, int y2, int x3, int y3) :Figure(3)
{
@@ -15,6 +18,7 @@ public:
}
double getArea()
{
+ //Херонова формула
double halfP = getPer()/2;
return sqrt(halfP * (halfP-getSide(0))*(halfP-getSide(1))*(halfP-getSide(2)));
}