# How to find the vertices angle after rotation

I drew this picture to interpret my question.

I have the x and y axis for all the vertices before rotating the object. And I have the angle of rotation, how can I find the x and y axis for the vertices after rotating the object.

Thanks

-
Ali AlNoaimi I think you have your coordinates for point D mixed up-its supposed to be x=5 and y=1. – ishtar18 Jun 26 '14 at 17:14

When a point $(x,y)$ is rotated about the origin $(0,0)$ counterclockwise by an angle $\theta$, the coordinates of the new point $(x',y')$ are \begin{align} x'&=x\cos(\theta)-y\sin(\theta), \\ y'&=x\sin(\theta)+y\cos(\theta).\end{align} Thus, when we rotate a point $(x,y)$ about another point $(p,q)$ counterclockwise by an angle $\theta$, we can compute the new point's coordinates by

1. translating the entire plane so that $(p,q)$ goes to the origin,
2. perform the rotation, and then
3. translate the entire plane back.

To translate $(p,q)$ to the origin, we subtract $p$ from $x$-coordinates and $q$ from $y$-coordinates, and to undo the operation we add instead of subtract. Thus, for example, after translating $(p,q)$ to the origin, the coordinates $(x,y)$ of our point have become $(x-p,y-q)$.

Therefore, the new point's coordinates are \begin{align} x'&=(x-p)\cos(\theta)-(y-q)\sin(\theta)+p, \\ y'&=(x-p)\sin(\theta)+(y-q)\cos(\theta)+q.\end{align} In your particular case, we can now see that the coordinates of the points $a$, $b$, $c$, and $d$ after rotation are \begin{align} a'&=((1-3)\cos(15)-(5-3)\sin(15)+3,(1-3)\sin(15)+(5-3)\cos(15)+3)\\\\ &=\left((-2)\left(\tfrac{1+\sqrt{3}}{2\sqrt{2}}\right)-(2)\left(\tfrac{-1+\sqrt{3}}{2\sqrt{2}}\right)+3,(-2)\left(\tfrac{-1+\sqrt{3}}{2\sqrt{2}}\right)-(2)\left(\tfrac{1+\sqrt{3}}{2\sqrt{2}}\right)+3\right)\\\\ &=(3-\sqrt{6},3+\sqrt{2})\\\\ &\approx(0.55051,4.41421)\\\\\\ b'&=((5-3)\cos(15)-(5-3)\sin(15)+3,(5-3)\sin(15)+(5-3)\cos(15)+3)\\\\ &=\left((2)\left(\tfrac{1+\sqrt{3}}{2\sqrt{2}}\right)-(2)\left(\tfrac{-1+\sqrt{3}}{2\sqrt{2}}\right)+3,(2)\left(\tfrac{-1+\sqrt{3}}{2\sqrt{2}}\right)-(2)\left(\tfrac{1+\sqrt{3}}{2\sqrt{2}}\right)+3\right)\\\\ &=(3+\sqrt{2},3+\sqrt{6})\\\\ &\approx(4.41421,5.44949)\\\\\\ c'&=((1-3)\cos(15)-(1-3)\sin(15)+3,(1-3)\sin(15)+(1-3)\cos(15)+3)\\\\ &=\left((-2)\left(\tfrac{1+\sqrt{3}}{2\sqrt{2}}\right)-(-2)\left(\tfrac{-1+\sqrt{3}}{2\sqrt{2}}\right)+3,(-2)\left(\tfrac{-1+\sqrt{3}}{2\sqrt{2}}\right)-(-2)\left(\tfrac{1+\sqrt{3}}{2\sqrt{2}}\right)+3\right)\\\\ &=(3-\sqrt{2},3-\sqrt{6})\\\\ &\approx(1.58579,0.55051)\\\\\\ d'&=((5-3)\cos(15)-(1-3)\sin(15)+3,(5-3)\sin(15)+(1-3)\cos(15)+3)\\\\ &=\left((2)\left(\tfrac{1+\sqrt{3}}{2\sqrt{2}}\right)-(-2)\left(\tfrac{-1+\sqrt{3}}{2\sqrt{2}}\right)+3,(2)\left(\tfrac{-1+\sqrt{3}}{2\sqrt{2}}\right)-(-2)\left(\tfrac{1+\sqrt{3}}{2\sqrt{2}}\right)+3\right)\\\\ &=(3+\sqrt{6},3-\sqrt{2})\\\\ &\approx(5.44949,1.58579)\\\\\\ \end{align}

Plotting these points in Mathematica demonstrates visually that our calculations were correct:

ListPlot[{{3 - Sqrt[6], 3 + Sqrt[2]}, {3 + Sqrt[2], 3 + Sqrt[6]},
{3 - Sqrt[2], 3 - Sqrt[6]}, {3 + Sqrt[6], 3 - Sqrt[2]}}, AspectRatio -> 1,
AxesOrigin -> {0, 0}, PlotMarkers -> {Automatic, Medium}, PlotStyle -> Blue]


-
Thanks a lot, what are the p and q, and how can I find them. – Ali AlNoaimi Jan 12 '13 at 11:29
The point $(p,q)$ represents the center about which you want to perform the rotation. In your case, you want to perform a rotation about the center of your square, which you can find quite easily by using the fact that the center is halfway between the left side of the square (which lies on the line $x=1$) and the right side of the square (which lies on the line $x=5$), as well as halfway between the top side ($y=5$) and the bottom side ($y=1$). Therefore the center of the square is at the point $$(p,q)=\left(\frac{1+5}{2},\frac{1+5}{2}\right)=(3,3).$$ – Zev Chonoles Jan 13 '13 at 6:23

I think you can move the origin to the point of center of the square first and then use a proper rotation matrix to find your new coordinates. In fact if the center of the square has coordinates $(x_0,y_0)$ in LHS picture, by shifting $(0,0)\to(x_0,y_0)$, every points in LHS picture with(X,Y) has $(X-x_0,Y-y_0)$ coordinates in RHS picture. Now use the proper rotation matrix noting that $\theta=15$. See http://en.wikipedia.org/wiki/Rotation_matrix

-

First, move your rectangle so that the center of rotation and origin overlaps. Now It's easy to compute rotation as point $(x,y)$ goes to $$(x\cos(\alpha) - y\sin(\alpha), x\sin(\alpha) + y\cos(\alpha))$$ And then move your rectangle back to the original position. We have $\sin(15^\circ)=\frac{\sqrt{3}-1}{2\sqrt{2}}$ and $\cos(15^\circ)=\frac{\sqrt{3}+1}{2\sqrt{2}}$ so for example for point $a$ we have $$(1,5) \to (-2,2) \to (-\sqrt{6},\sqrt{2}) \to (3-\sqrt{6}, 3+\sqrt{2})$$

-
Do you see my approach applicable here? Thanks. – Babak S. Jan 4 '13 at 9:48