Rotation around a given axis In $\mathbb{R^3}$, let $L=span{(1,1,0)}$, and let $T:\mathbb{R^3}\rightarrow \mathbb{R^3}$ be a rotation by $\pi/4$ about the axis $L$. Pick either direction. We accept the fact that T is a linear transformation. Find the matrix of T.
First I found an orthonormal basis for $L^{\perp}$: {$(\frac{-1}{\sqrt{2}},\frac{1}{\sqrt{2}},0),(0,0,1)$} and extended it to an orthonormal basis for $\mathbb{R^3}$: $\alpha$$=${$(\frac{-1}{\sqrt{2}},\frac{1}{\sqrt{2}},0),(0,0,1),(1,0,0)$}.
Now I want to find the matrix $_{\alpha}[T]_{\alpha}$ so I have to find $T(\frac{-1}{\sqrt{2}},\frac{1}{\sqrt{2}},0)$, $T(0,0,1)$ and $T(1,0,0)$ but I have no clue how to do that, i.e. no clue how to rotate these vectors geometrically to find their translation.
 A: I would this as follows. 
First notice that you get the unit vector $\vec{u}=(1/\sqrt2,1/\sqrt2,0)$ parallel to $L$ by rotating the the standard basis vector
$\vec{i}=(1,0,0)$ 45 degrees about the $z$-axis. Let $T_1$ be that rotation.
I assume that you know how to jot down a matrix of $T_1$.
Let $T_2$ be a rotation about the $x$-axis. This is something you should also be able to construct. Then I claim that $T_1\circ T_2\circ T_1^{-1}$ is the prescribed rotation about $\vec{u}$. This is easy to understand. First the inverse $T_1^{-1}$ will rotate the universe in such a way that the image of $\vec{u}$ points in the direction of the positive $x$-axis. Then you rotate the
universe about that $x$-axis by performing $T_2$. Observe that this means that the image of any vector gets rotates 45 degrees about the the image of $\vec{u}$. So when we in the end cancel the first rotation by performing $T_1$, the vector $\vec{u}$ (whose image did not move in the second step, because it was the axis of rotation $T_2$) returns to its original version, and the rest of the universe becames rotated by 45 degree about it.
Alternatively you can just use the change of basis matrix connecting your basis $\alpha$ and the natural basis in place of $T_1$ above. Careful about the direction of the change of basis though! Then the idea would be that you know what your rotation looks like when you are doing it using basis $\alpha$ (but do fix that third vector, because it is not orthogonal to both the others). Then you do the usual change of basis magic to rewrite that matrix in terms of the natural basis. It all amounts to more or less the same.
A: I am assuming that by "find the matrix", we are finding the matrix representation in the standard basis.
Write down the rotation matrix in 3D space about 1 axis, i.e. around the first axis,
\begin{equation} T' = 
\begin{pmatrix}
1&0&0\\
0&\cos{\theta} & -\sin{\theta} \\
0&\sin{\theta} & \cos{\theta}
\end{pmatrix}
\end{equation}
Consider this matrix as being represented in the basis $\{e_1,e_2,e_3\}$ where $e_1$ = "axis of rotation", and $e_2$ and $e_3$ are perpendicular to $e_1.$ In this case, $e_1$ will be (1,1,0).  We may take $e_2$ = (0,0,1) and $e_3 = e_1 \times e_2.$
Define the matrix $E = (\; e_1 \;|\; e_2 \;|\; e_3 \;).$
Then if $T$ is the representation in the standard basis, 
\begin{equation}
T = E\;T'E^{-1}
\end{equation}
A: In this link: https://arxiv.org/abs/1404.6055 , a general formula of 3D rotation was given based on 3D homogeneous coordinates. 

For those cases when the rotation axes do not pass through the coordinate system origin, homogenous coordinates have to be used since there is no square matrix can be used to represent the rotation only in Euclidean geomety: it is in the domain of projective geometry.
For cases when rotation axes passing through coordinate system origin, the formula in https://arxiv.org/abs/1404.6055 still can be used: first obtain the 4$\times$4 homogeneous rotation, then truncate it into 3$\times$3 with only the left-up 3$\times$3 sub-matrix left, the left block matrix would be the desired.
