matrix for rotation and translation along it's local axis I came across a particular situation when I would like to rotate an object at the origin and then translate it along its local axis.(everything here is for 2D). The transformation required is shown as:   

Let us consider the rotation required is <45 deg and the transformation matrix is R. Similarly, the translation is W  units in +ve X and 0 in Y i.e. W > 0, such that the triangle doesn't leave the grid and the translation matrix is T.(These are assumptions just for the sake of illustrations I am about to present)
Now, if I do the transformation RT, the result would be:
 
and if I do the transformation TR, the result would be:

None of which is actually giving the required transformation, but one possible way would be to do the following:   


*

*Rotate the triangle (R) 

*Align the triangle to the Y-axis(R-1)

*Translate(T)

*Perform the inverse of 2(R)
The series is thus:  R.T.R-1.R, which in effect is R.T which as shown above, RT is not the transformation we want.  


R.T.R-1.R transformation shown below as:

So, what am I missing here, is there some kind of mistake here? How do we achieve the required composite transformation? Any help would be appreciated. Thanks in advance. 
 A: The group of orientation preserving (rigid) motions of the plane is isomorphic to the subgroup of $GL_2(\mathbb C)$ of the form  
$\begin{bmatrix}
a & b \\ 
 0& 1
\end{bmatrix}$
where $a$ is on the unit circle.  
This is a problem in the symmetry chapter of Artin's Algebra, first edition.  (The entire chapter is devoted to things of this nature and the first edition is quite cheap...)  
If you prefer to work in reals, then convince yourself that is isomorphic to  
$\begin{bmatrix}
\cos(\theta) & -\sin(\theta) & b_1\\ 
\sin(\theta) & \cos(\theta) & b_2\\
 0&0& 1
\end{bmatrix}$ 
and your coordinates for your original 'point' are given by 
$\mathbf x = \begin{bmatrix}
x_1\\ 
x_2\\
1
\end{bmatrix}$
(the bottom coordinate must always be fixed at 1)  
Form of the matrix for your problem
Evidently you have a translation of length $r$ along the $x_1$ axis (given by standard basis vector $\mathbf e_1\in \mathbb R^3$), then a rotation, so    
$\begin{bmatrix}
\cos(\theta) & -\sin(\theta) & b_1\\ 
\sin(\theta) & \cos(\theta) & b_2\\
 0&0& 1
\end{bmatrix}\mathbf x $
$= \begin{bmatrix}
\cos(\theta) & -\sin(\theta) & 0\\ 
\sin(\theta) & \cos(\theta) &0\\
 0&0& 1
\end{bmatrix}\big(\mathbf x + r\mathbf e_1\big) $
$=\begin{bmatrix}
\cos(\theta) & -\sin(\theta) & 0\\ 
\sin(\theta) & \cos(\theta) &0\\
 0&0& 1
\end{bmatrix}\mathbf x +  r\begin{bmatrix}
\cos(\theta) & -\sin(\theta) & 0\\ 
\sin(\theta) & \cos(\theta) &0\\
 0&0& 1
\end{bmatrix}\mathbf e_1$
$=\begin{bmatrix}
\cos(\theta) & -\sin(\theta) & 0\\ 
\sin(\theta) & \cos(\theta) &0\\
 0&0& 1
\end{bmatrix}\mathbf x +  r\begin{bmatrix}
\cos(\theta)  \\ 
\sin(\theta) \\
 0
\end{bmatrix}$
$= r\begin{bmatrix}
\cos(\theta)  \\ 
\sin(\theta) \\
 0
\end{bmatrix} +\begin{bmatrix}
\cos(\theta) & -\sin(\theta) & 0\\ 
\sin(\theta) & \cos(\theta) &0\\
 0&0& 1
\end{bmatrix}\mathbf x$
which satisfies the rules from composition of rotations and translations (2.5) given earlier in the chapter.    
note: equations can be read forward and backward.  If you start at the bottom and read this backward, it reads as "I... rotate an object at the origin and then translate it."  (as stated in OP.)  
conclusion: this tells you that $b_1 = r\cos(\theta)$ and $b_2 = r\sin(\theta)$ 
