I'm having problems wrapping my head around why this produces wrong results.
I have 4 corners of a 2d rectangle:
Vec2 bottom_left(-10.0, -10.0);
Vec2 bottom_right(10.0, -10.0);
Vec2 top_left(-10.0, 10.0);
Vec2 top_right(10.0, 10.0);
I want to rotate the rectangle say 35 degrees.
So i do this for every corner: Vec2.rotate(35.0);
rotate() looks like (I convert to radians):
x = std::cos(radians)*x - std::sin(radians)*y;
y = std::sin(radians)*x + std::cos(radians)*y;
But the result I'm getting is distorted:
As you can see the corner angles isn't 90 degrees anymore and well, that's my question :)