2D Coordinate Rotation

Article by:
Date Published:
Last Modified:

A 2D coordinate \((x_1, y_1)\) can be easily rotated by \(\theta\) around another point \((x_c, y_c)\) to give the new rotated point \((x_2, y_2)\) with the equation:

$$x_2 = (x_1 - x_c) cos(\theta) - (y_1 - y_c) sin(\theta) + x_c$$ $$y_2 = (x_1 - x_c) sin(\theta) + (y_1 - y_c) cos(\theta) + y_c$$

The angle \(\theta\) is positive for a counter-clockwise rotation. You may notice that the coordinate is translated as if \((x_c, y_c)\) was the origin, the rotation transformation is applied, and then it is translated back into position.


Authors

Geoffrey Hunter

Dude making stuff.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License .

Related Content:

Tags

comments powered by Disqus