triangle, rotate 45 degrees around the centroid 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?
 A: 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.
A: 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)$$
