I implemented the logic to rotate rectangle $90$ degree but the logic is not working for complete $360$. It rotates until $90$ then goes in reverse direction until $180$ then again come back on $225$ then again goes in reverse direction for $360$.
Means its going and coming back only in one quadrant.
The method I used is
- Found the center of rectangle
- Changed centre of position to orgin
- Did rotation
- Took back to original position
Logic used is $(x\cos\theta−y\sin\theta ,x\sin\theta+y\cos\theta)$.
Do I need another logic for complete $360$ degree rotation?