Vector2d:fix rotate bug

This commit is contained in:
ChenOrange
2022-07-03 16:22:28 +02:00
committed by Uwe
parent cc90163850
commit 6a44d1e8ff
+2 -1
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;
}