Circle.h 627 B

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