mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 11:17:51 -06:00
Eradicated most of Pointf extras compared to pure Eigen::Vector2d.
This commit is contained in:
parent
cb138a20b8
commit
cae0806112
21 changed files with 68 additions and 103 deletions
|
@ -153,28 +153,6 @@ std::ostream& operator<<(std::ostream &stm, const Pointf &pointf)
|
|||
return stm << pointf(0) << "," << pointf(1);
|
||||
}
|
||||
|
||||
void Pointf::rotate(double angle)
|
||||
{
|
||||
double cur_x = (*this)(0);
|
||||
double cur_y = (*this)(1);
|
||||
double s = ::sin(angle);
|
||||
double c = ::cos(angle);
|
||||
(*this)(0) = c * cur_x - s * cur_y;
|
||||
(*this)(1) = c * cur_y + s * cur_x;
|
||||
}
|
||||
|
||||
void Pointf::rotate(double angle, const Pointf ¢er)
|
||||
{
|
||||
double cur_x = (*this)(0);
|
||||
double cur_y = (*this)(1);
|
||||
double s = ::sin(angle);
|
||||
double c = ::cos(angle);
|
||||
double dx = cur_x - center(0);
|
||||
double dy = cur_y - center(1);
|
||||
(*this)(0) = center(0) + c * dx - s * dy;
|
||||
(*this)(1) = center(1) + c * dy + s * dx;
|
||||
}
|
||||
|
||||
namespace int128 {
|
||||
|
||||
int orient(const Vec2crd &p1, const Vec2crd &p2, const Vec2crd &p3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue