I have a triangle and its center and I need to rotate it $45$ degrees around its center in clockwise direction. The coordinates are $$A(5,20)\quad B(5,30)\quad C(15, 25)$$ so the center is $O(\frac{25}3 , 25)$. How do I rotate it $45$ degrees?
triangle, rotate 45 degrees around the centroid
-
0Which direction? Clockwise or Counter-clockwise? – 2017-01-29
-
1clockwise, just edited. thanks. – 2017-01-29
-
0Translate the coordinates so the centroid coincides with the origin, multiply the coordinates by the rotation matrix, then translate the coordinates back again. – 2017-01-29
-
0Didn't really understand. – 2017-01-29
-
0Would you mind getting me an example please? – 2017-02-05
2 Answers
Let us derive a formula for rotating a point $(x_1,y_1)$ clockwise about another point $(x_0,y_0)$.
First we translate the point so that the point $(x_0,y_0)$ becomes the origin. We do this by subtracting $x_0$ from the $x$ coordinate of all points, and subtracting $y_0$ from the $y$ coordinate of all points.
So now our two point become $(x_1-x_0,y_1-y_0)$ and the origin.
Now let's shift our attention to something else what happens when your rotate the unit vector $\vec i=\langle 1,0 \rangle$ clockwise $\theta$ degrees about the origin.
We get the vector $\langle \cos (\theta), -\sin (\theta) \rangle$.
What happens when we rotate the vector $\vec j=\langle 0,1 \rangle$ in the same way. We get the vector $\langle \sin (\theta), \cos (\theta) \rangle$.
Now why are we interested in these two vectors? Well because, it turns out that rotation in two dimensions clockwise about the origin is a linear operator. Meaning that if $x_1-x_0$ and $y_1-y_0$ are constants we have,
$$\text{Rot}_{\theta}((x_1-x_0) \vec V+(y_1-y_0) \vec W)=(x_1-x_0)\text{Rot}_{\theta} \vec V+(y_1-y_0) \text{Rot}_{\theta} \vec W$$
Now we write the point we want to rotate, that being $(x_1-x_0,y_1-y_0)$ as a vector $\langle x_1-x_0, y_1-y_0 \rangle=(x_1-x_0) \vec i+(y_1-y_0) \vec j $
And we rotate noting the $\text{Rot}$ function is a linear operator.
$$\text{Rot}_{\theta}((x_1-x_0) \vec i+(y_1-y_0) \vec j )$$
$$=(x_1-x_0)\text{Rot}_{\theta} \vec i+(y_1-y_0) \text{Rot}_{\theta} \vec j$$
$$=(x_1-x_0) \langle \cos (\theta), -\sin (\theta) \rangle+(y_1-y_0)\langle \sin (\theta), \cos (\theta) \rangle$$
$$=\langle (x_1-x_0) \cos (\theta)+(y_1-y_0) \sin (\theta), -(x_1-x_0)\sin (\theta)+(y_1-y_0) \cos (\theta) \rangle$$
Finally we undo the translation we did in the begging by adding $x_0$ and $y_0$ to the $x$ and $y$ coordinate respectively to get.
$$\left((x_1-x_0) \cos (\theta)+(y_1-y_0) \sin (\theta)+x_0, -(x_1-x_0)\sin (\theta)+(y_1-y_0) \cos (\theta)+y_0 \right)$$
Rotating $A$ gives,
$$\left((5-\frac{25}{3})\frac{\sqrt{2}}{2}+(20-25) \frac{\sqrt{2}}{2}+\frac{25}{3}, -(5-\frac{25}{3})\frac{\sqrt{2}}{2}+(20-25) \frac{\sqrt{2}}{2}+25 \right)$$
This is approximately,
$$(2.4408,23.8215)$$
-
0Hello. I still didn't get the right result, would you mind doing just A as an example then I do the others please? I'm really stuck. thanks very much in advance. – 2017-02-05
-
0@Gab Did you get it? – 2017-02-05
When we rotate $P(x_1, y_1)$ about a point $Q(x_2,y_2)$ by an angle $\theta$, the coordinates of the final point can be obtained as $$ X_1 + iy_1 + ((x_2 - x_1) + i(y_2-y_1))(\cos \theta - i\sin \theta)$$ where $i^2 = -1$.
In the present case we have the transformed coordinates of $A$ are $$\frac{25}{5} +25i + (\left(5-\frac{25}{5}\right)+i(20-25))\left(\frac{1}{\sqrt{2}}-i\frac{1}{\sqrt{2}}\right)$$ which can be easily calculated.
-
0I have tried and still didn't get it right, i've used a calculator online which is not my intention here, i got the right result approximately A(2.4, 24) B (9.5, 31) C (13, 20), I checked them in the graphic and they match, is that the formula for that? thanks very much – 2017-01-29
-
0Can you help me? – 2017-01-29
