/
polytech_kolomna
/
aipackaging_math
Обзор
Документация
Войти
/
polytech_kolomna
/
aipackaging_math
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
1
CI/CD
Аналитика
intersections
src/geometry/point2d.cpp
51 строка
833 B
Olegh
lower case
28 окт 2025, 21:08
28 окт 2025, 21:08
037a99f
Код
Авторство
О чём код?
#include <cmath> #include <mathutils.h> #include <vector2d.h> #include <point2d.h> // Vector2D Point2D::operator-(const Point2D& other) const { return Vector2D{ x - other.x, y - other.y }; } // Point2D Point2D::operator+(const Vector2D& other) const { return Point2D{ x + other.x, y + other.y }; } // Point2D& Point2D::operator+=(const Vector2D& other) { x += other.x; y += other.y; return *this; } // bool Point2D::operator==(const Point2D& other) const { return (std::abs(x - other.x) < MathConstants::TOLERANCE_DOUBLE) && (std::abs(y - other.y) < MathConstants::TOLERANCE_DOUBLE); } // bool Point2D::operator!=(const Point2D& other) const { return !(*this == other); } // std::ostream& operator<<(std::ostream& out, const Point2D& other) { out << "{ " << other.x << " ; " << other.y << " }"; return out; }