# Formula For Rotating a Point about anotherPoint

• Aug 19th 2009, 01:26 AM
ManuLi
Formula For Rotating a Point about another Point
Hi,

I need to rotate a point P1(x1,y1) about a pivot point P2(x2,y2) at an angle 'a'. What is the formula for calulating the new point?

Manu
• Aug 19th 2009, 10:16 AM
running-gag
Quote:

Originally Posted by ManuLi
Hi,

I need to rotate a point P1(x1,y1) about a pivot point P2(x2,y2) at an angle 'a'. What is the formula for calulating the new point?

Manu

Hi

$x' = x_2 + (x_1 - x_2) \cos a - (y_1 - y_2) \sin a$
$y' = y_2 + (y_1 - y_2) \cos a + (x_1 - x_2) \sin a$
• Aug 19th 2009, 05:44 PM
HallsofIvy
Quote:

Originally Posted by running-gag
Hi

$x' = x_2 + (x_1 - x_2) \cos a - (y_1 - y_2) \sin a$
$y' = y_2 + (y_1 - y_2) \cos a + (x_1 - x_2) \sin a$

What running-gag did was "translate" the point $(x_2, y_2)$ to the origin (0,0) (that's the $x_1- x_2$ and $y_1-y_2$ part) then rotate about the origin, the translate back (that's why he added $x_2$ and $y_2$).
• Aug 20th 2009, 10:15 AM
running-gag
Quote:

Originally Posted by HallsofIvy
What running-gag did was "translate" the point $(x_2, y_2)$ to the origin (0,0) (that's the $x_1- x_2$ and $y_1-y_2$ part) then rotate about the origin, the translate back (that's why he added $x_2$ and $y_2$).

Thanks, my "explanation" was a little bit short (Happy)