I have a triangle with the coordinates (0, 20), (15, -10), (-15, -10). So the centre of the triangle is 0,0.
I want to rotate this by one degree. Im using the formula:
x' = cos(theta)*x - sin(theta)*y
y' = sin(theta)*x + cos(theta)*y
Yet when I work out the coordinate for angle rotation of 1, I get completely inexplicable coordinates:
(-16.82941969615793, -3.3554222481086295), (16.51924443610106, 8.497441825246927), (0.31017526005686946, -5.142019577138298)
Which when plotted out looks nothing like the original triangle being rotated by 1 degree. I've made a simple demo in javascript here.
What could i be possibly doing wrong?