Vector2d:fix rotate bug

This commit is contained in:
ChenOrange
2022-07-02 16:41:58 +08:00
committed by Uwe
parent e2250d6966
commit 90469005aa

View File

@@ -339,8 +339,9 @@ inline Vector2d& Vector2d::Scale(double factor)
inline Vector2d& Vector2d::Rotate(double angle)
{
decltype(x) tmp_x = x;
x = x*cos(angle) - y*sin(angle);
y = x*sin(angle) + y*cos(angle);
y = tmp_x * sin(angle) + y * cos(angle);
return *this;
}