Finding new coordinates in simple rotation on x-y plane I have a problem where I want to rotate branch so that one of its sides is on the y-axis and the centre of the branch is moved to (x=0,y=0). I want to know the values of the new rotated coordinates in terms of the original coordinates. See picture below:
Rotating problem
To get yp2* is obvious to me because it's the length of the side but I can't  get the other rotated coordinates in terms of the original coordinates.
 A: If the angles between the three branches are all $2\pi/3$, and the branches that appear to be vertical are vertical, as the drawing suggests, then you're looking at a translation followed by a clockwise rotation by $\pi/3$ radians.
You ought to just write out that transformation, and then you will know the destination of any point.
The translation alone is $\left[\begin{smallmatrix}x\\y\end{smallmatrix}\right]\mapsto \left[\begin{smallmatrix}x-x_{p1}\\y-y_{p1}\end{smallmatrix}\right]$.
The rotation is $\left[\begin{smallmatrix}x\\y\end{smallmatrix}\right]\mapsto \left[\begin{smallmatrix}\frac12 &\frac{\sqrt{3}}{2}\\  -\frac{\sqrt{3}}{2}&\frac12\end{smallmatrix}\right]\left[\begin{smallmatrix}x\\y\end{smallmatrix}\right]$. If you don't recognize how I'm getting a rotation matrix with an angle, you really ought to google the topic.
Compose these two transformations, and you have a mapping from old points to new points.
If the angles are not as they appear, then the procedure is the same, you just have to deduce the angle of rotation for the rotation matrix. By simple trigonometry on the branch getting rotated downward, the angle is $\arccos\left(\frac{x_{p2}}{\sqrt{x_{p2}^2+y_{p2}^2}}\right)$.
A: rschwieb makes a good point describing with matrix multiplication, if you are well versed in matrices and vectors you can even write the whole thing together as a composition of two linear operators by matrix multiplication of a representation of affine transformations on the vector ${\bf v} = [x,y,1]^T$:
First out is the translation which we call $\bf G_T$:
$${\bf G_T} = \left[\begin{array}{rrr} 1 & 0 & -x_{pl} \\ 0 & 1 & -y_{pl} \\ 0& 0&1 \end{array}\right]$$
Now for our rotation which we call $\bf{G_R}$ (compare this to the other answer, it is very similar!)
$$ {\bf G_R} = \left[\begin{array}{rrr} \frac{1}{2} & \frac{\sqrt{3}}{2} & 0 \\ -\frac{\sqrt{3}}{2} & \frac{1}{2} & 0 \\ 0& 0& 1 \end{array}\right]$$
So everything together becomes $${\bf G_R} {\bf G_T} {\bf v}$$
This way of thinking may seem a bit overkill for this example but is useful if you want to do more complicated things later. To systematically build up expressions.
