Rectangle.h 723 B

1234567891011121314151617181920212223242526272829303132
  1. #include "Figure.h"
  2. class Rectangle: public Figure
  3. {
  4. private:
  5. double x1, y1, x2, y2, x3, y3, x4, y4;
  6. template <typename T>
  7. void init(T X1, T Y1, T X2, T Y2, T X3, T Y3, T X4, T Y4)
  8. {
  9. x1 = double(X1);
  10. y1 = double(Y1);
  11. x2 = double(X2);
  12. y2 = double(Y2);
  13. x3 = double(X3);
  14. y3 = double(Y3);
  15. x4 = double(X4);
  16. y4 = double(Y4);
  17. }
  18. public:
  19. template <typename T>
  20. Rectangle(T X1, T Y1, T X2, T Y2, T X3, T Y3, T X4, T Y4)
  21. {
  22. init(X1, Y1, X2, Y2, X3, Y3, X4, Y4);
  23. }
  24. Rectangle(struct Point f, struct Point s, struct Point t, struct Point fo);
  25. double calc_area();
  26. double calc_perimiter();
  27. void name();
  28. };