Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Triangle.hpp
diff options
context:
space:
mode:
Commit730189c846b762c42fba955ca6a01d3a2fbf7acf (patch)
Author
 Angeld55 <achi_d@abv.bg>
2019-09-19 21:19:25 +0300
Committer
 GitHub <noreply@github.com>
2019-09-19 21:19:25 +0300
Files3ec5822f7b727f9d9f05d46f7d4683208e230f81 /Polymorphism/Triangle.hpp
Object-oriented_programming_FMI-730189c846b762c42fba955ca6a01d3a2fbf7acf.tar
Object-oriented_programming_FMI-730189c846b762c42fba955ca6a01d3a2fbf7acf.tar.gz
Object-oriented_programming_FMI-730189c846b762c42fba955ca6a01d3a2fbf7acf.zip
Parentf381519ea261d66a6154013e17d157a27ab14880 (diff)
Rename Polymorphism/Triangle.hpp to Polymorphism/Figures/Triangle.hpp
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