Ellips.h 710 B

123456789101112131415161718192021222324252627282930313233
  1. #include "Figure.h"
  2. class Ellips: public Figure
  3. {
  4. private:
  5. double centerX, centerY, axisA, axisB;
  6. template <typename T>
  7. void init(T center_x, T center_y, T axis_a, T axis_b)
  8. {
  9. centerX = double(center_x);
  10. centerY = double(center_y);
  11. axisA = double(axis_a);
  12. axisB = double(axis_b);
  13. }
  14. public:
  15. template <typename T>
  16. Ellips(T center_x, T center_y, T axis_a, T axis_b)
  17. {
  18. init(center_x, center_y, axis_a, axis_b);
  19. }
  20. template <typename T>
  21. Ellips(struct Point center, T axis_a, T axis_b)
  22. {
  23. init(center.x, center.y, axis_a, axis_b);
  24. }
  25. double calc_area();
  26. double calc_perimiter();
  27. void name();
  28. };