/
polytech_kolomna
/
aipackaging_math
Обзор
Документация
Войти
/
polytech_kolomna
/
aipackaging_math
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
1
CI/CD
Аналитика
intersections
include/vector2d.h
42 строки
1 KB
Olegh
lower case
28 окт 2025, 21:08
28 окт 2025, 21:08
037a99f
Код
Авторство
О чём код?
#ifndef VECTOR2D_H #define VECTOR2D_H #include <aipackagingmathexport.h> // Вектор в 2D пространстве struct AIPACKAGING_MATHLIB_API Vector2D { // Длина вектора double length() const; // Получить нормализованный вектор Vector2D normalized() const; // Псевдовекторное произведение double pseudoCrossProduct(const Vector2D& other) const; // Скалярное произведение double dotProduct(const Vector2D& other) const; // Сложение векторов Vector2D operator+(const Vector2D& other) const; Vector2D& operator+=(const Vector2D& other); // Вычитание вектора Vector2D operator-(const Vector2D& other) const; Vector2D& operator-=(const Vector2D& other); // Умножение на скаляр Vector2D operator*(double scalar) const; Vector2D& operator*=(double scalar); // Сравнение векторов bool operator==(const Vector2D& other) const; bool operator!=(const Vector2D& other) const; public: double x{}; double y{}; }; #endif