20
$\begingroup$

I drew this picture to interpret my question.

enter image description here

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

$\endgroup$
1
  • 2
    $\begingroup$ Ali AlNoaimi I think you have your coordinates for point D mixed up-its supposed to be x=5 and y=1. $\endgroup$
    – ishtar18
    Commented Jun 26, 2014 at 17:14

3 Answers 3

26
$\begingroup$

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]

enter image description here

$\endgroup$
4
  • $\begingroup$ Thanks a lot, what are the p and q, and how can I find them. $\endgroup$ Commented Jan 12, 2013 at 11:29
  • 1
    $\begingroup$ 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).$$ $\endgroup$ Commented Jan 13, 2013 at 6:23
  • 1
    $\begingroup$ Loved the detailed explanation. Big Help !! $\endgroup$ Commented Jun 29, 2020 at 15:02
  • 1
    $\begingroup$ joined the community just to upvote this answer $\endgroup$ Commented Feb 7, 2021 at 21:08
3
$\begingroup$

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

$\endgroup$
1
$\begingroup$

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})$$

$\endgroup$
1
  • $\begingroup$ Do you see my approach applicable here? Thanks. $\endgroup$
    – Mikasa
    Commented Jan 4, 2013 at 9:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .