/
polytech_kolomna
/
aipackaging_math
Обзор
Документация
Войти
/
polytech_kolomna
/
aipackaging_math
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
1
CI/CD
Аналитика
intersections
include/rect2d.h
39 строк
867 B
Olegh
lower case
28 окт 2025, 21:08
28 окт 2025, 21:08
037a99f
Код
Авторство
О чём код?
#ifndef RECT2D_H #define RECT2D_H #include <aipackagingmathexport.h> #include <point2d.h> // Прямоугольник в 2D пространстве class AIPACKAGING_MATHLIB_API Rect2D { public: Rect2D(const Point2D& first, const Point2D& second); Point2D topLeft() const; Point2D topRight() const; Point2D bottomLeft() const; Point2D bottomRight() const; Point2D center() const; double top() const; double left() const; double right() const; double bottom() const; bool intersects(const Rect2D& rect) const; bool contains(const Rect2D& rect) const; bool contains(const Point2D& point) const; bool operator==(const Rect2D& other) const; bool operator!=(const Rect2D& other) const; AIPACKAGING_MATHLIB_API friend std::ostream& operator<<(std::ostream& out, const Rect2D& other); private: Point2D topLeft_; Point2D bottomRight_; }; #endif