/
polytech_kolomna
/
aipackaging_math
Обзор
Документация
Войти
/
polytech_kolomna
/
aipackaging_math
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
1
CI/CD
Аналитика
intersections
src/geometry/boundedcurve2d.cpp
91 строка
1 KB
Olegh
lower case
28 окт 2025, 21:08
28 окт 2025, 21:08
037a99f
Код
Авторство
О чём код?
#include <cassert> #include <memory> #include <algorithm> #include <matrix3.h> #include <point2d.h> #include <vector2d.h> #include <boundedcurve2d.h> // BoundedCurve2D::BoundedCurve2D(std::shared_ptr<ICurve2D> curve, double minT, double maxT): curve_(std::move(curve)), minT_(minT), maxT_(maxT) { assert(curve_); if (minT_ > maxT_) std::swap(minT_, maxT_); } // Point2D BoundedCurve2D::getPoint(double t) const { t = std::clamp(t, minT_, maxT_); return curve_->getPoint(t); } // void BoundedCurve2D::move(const Vector2D& offset) { curve_->move(offset); } // void BoundedCurve2D::scale(double scaleX, double scaleY) { curve_->scale(scaleX, scaleY); } // void BoundedCurve2D::rotate(double radian) { curve_->rotate(radian); } // void BoundedCurve2D::transform(const Matrix3& matrix) { curve_->transform(matrix); } // double BoundedCurve2D::getMinT() const { return minT_; } // double BoundedCurve2D::getMaxT() const { return maxT_; } // void BoundedCurve2D::setMinT(double t) { minT_ = t; if (minT_ > maxT_) std::swap(minT_, maxT_); } // void BoundedCurve2D::setMaxT(double t) { maxT_ = t; if (minT_ > maxT_) std::swap(minT_, maxT_); }