Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef PROG_4_RECTANGLE_H
- #define PROG_4_RECTANGLE_H
- #include <cmath>
- #include "Figure.h"
- class CRectangle : public CFigure {
- private:
- SPoint p1_;
- SPoint p2_;
- SPoint p3_;
- SPoint p4_;
- float mass_;
- double get_dist(SPoint one, SPoint two) const {
- return std::sqrt(std::pow(two.x_ - one.x_, 2) + std::pow(two.y_ - one.y_, 2));
- }
- public:
- CRectangle(CRectangle &other);
- CRectangle();
- void operator=(const CRectangle &other);
- [[nodiscard]] double mass() const override;
- CVector2D position() override;
- bool operator==(const IPhysObject &ob) const override;
- bool operator<(const IPhysObject &ob) const override;
- const char *classname() override;
- unsigned size() override;
- void initFromDialog() override;
- double perimeter() override;
- double square() override;
- void draw() override;
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement