Figure.h 389 B

123456789101112131415161718192021222324
  1. #ifndef _GEOMETRY_H
  2. #define _GEOMETRY_H
  3. #include <math.h>
  4. struct Point
  5. {
  6. double x, y;
  7. };
  8. class Figure
  9. {
  10. protected:
  11. double l2(double x1, double y1, double x2, double y2)
  12. {
  13. return sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
  14. }
  15. public:
  16. virtual double calc_area() = 0;
  17. virtual double calc_perimiter() = 0;
  18. virtual void name() = 0;
  19. };
  20. #endif