Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. #ifndef PROG_4_RECTANGLE_H
  2. #define PROG_4_RECTANGLE_H
  3.  
  4. #include <cmath>
  5. #include "Figure.h"
  6.  
  7. class CRectangle : public CFigure {
  8. private:
  9.  
  10.     SPoint p1_;
  11.     SPoint p2_;
  12.     SPoint p3_;
  13.     SPoint p4_;
  14.     float mass_;
  15.  
  16.     double get_dist(SPoint one, SPoint two) const {
  17.         return std::sqrt(std::pow(two.x_ - one.x_, 2) + std::pow(two.y_ - one.y_, 2));
  18.     }
  19.  
  20. public:
  21.  
  22.     CRectangle(CRectangle &other);
  23.  
  24.     CRectangle();
  25.  
  26.     void operator=(const CRectangle &other);
  27.  
  28.     [[nodiscard]] double mass() const override;
  29.  
  30.     CVector2D position() override;
  31.  
  32.     bool operator==(const IPhysObject &ob) const override;
  33.  
  34.     bool operator<(const IPhysObject &ob) const override;
  35.  
  36.     const char *classname() override;
  37.  
  38.     unsigned size() override;
  39.  
  40.     void initFromDialog() override;
  41.  
  42.     double perimeter() override;
  43.  
  44.     double square() override;
  45.  
  46.     void draw() override;
  47. };
  48.  
  49.  
  50.  
  51. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement