# Formula For Rotating a Point about anotherPoint

• Aug 19th 2009, 12: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, 09: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

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

Originally Posted by running-gag
Hi

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

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

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

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