Find the rotation matrix about an arbitrary axis I have the following question. Find the matrix representation of the transormation $T:\mathbb{R}^3\to\mathbb{R}^3$ that rotates any vector by $\theta=\frac{\pi}{6}$ along the vector $v=(1,1,1)$.
A hint is given to find the rotation matrix about the $z-axis$ by $\frac{\pi}{6}$which is $$
\begin{bmatrix}
   \frac{\sqrt{3}}{2} &\frac{-1}{2} & 0 \\
\frac{1}{2} & \frac{\sqrt{3}}{2} & 0 \\
0 & 0 &1
\end{bmatrix}
$$
and then find an orthogonal basis for $\mathbb{R}^3$ that has $v$ as one of its vector then finally rewrite the above matrix using the new basis and that should be my answer.
My questions are 


*

*Do I pick two random vectors and join them to $v$ and use the Gram-Schmidt process to get an orthogonal basis.

*Why does that work?

 A: The Gram-Schmidt process is a rather tedious way to do such a simple geometric task.
First, the plane $P$ orthogoal to $v = (1,1,1)$ is $x+y+z=0$.
Second, pick any vector $P$ in that plane, say $w = (1,-1,0)$.
Third, let $u$ be the cross product of $v,w$: 
$$u = v \times w = (1,1,1) \times (1,-1,0) = (1,1,-2)
$$
It follows that $\{v,w,u\}$ is an orthogonal basis.
Finally, a note of caution: before proceeding to rewrite the rotation matrix using this new basis, what you really want is an orthonormal basis, hence you should first normalize the basis by replacing $v$ with $\frac{v}{|v|}$ and similarly for $w$ and $u$.
A: To understand why it works, let's use an analogy: imagine the linear transformation $T$
as a database that contains answers to a set of questions:
a question is any vector $u$, the answer to
question $u$ is the vector $T \left(u\right)$.
Questions need to be asked in a certain language, as concrete
vectors need to be given by their coordinates in a certain basis.
That's where matrices intervene. Matrices are machines that take
a question in some input language and return the answer in some
output language, often, but not necessarily the same language.
Suppose that we have an old machine $E$ that takes questions in english
and returns answers in english. We can use it to create a new machine
that takes question in chinese and returns answers in chinese,
    it works in three steps:


*

*Translate the question from chinese to english.

*Get the answer in english by using the $E$ machine.

*Translate the answer from english to chinese.


In terms of vectors and matrices it becomes


*

*Transform the new basis coordinates of vector $u$ to the old basis.

*Compute $T \left(u\right)$ by using the matrix in the old basis.

*Transform the old basis coordinates of $T \left(u\right)$ in the new basis.


The matrix that translate the question from chinese to english
is called the transition matrix. The
matrix that translates the answer from english to chinese is
simply the inverse of the transition matrix.
The columns of the transition matrix are the coordinates of the
new basis vectors in the old basis. The columns of the inverse
of the transition matrix are the coordinates of the old basis
vectors in the new basis.
In your case, the new basis is the standard basis of ${\mathbb{R}}^{3}$,
the old basis is an orthonormal basis where the matrix of $T$
is the matrix you wrote above.
Looking at the vectors given in @LeeMosher's answer, the old basis
can be
$$\left(\frac{w}{\left\|w\right\|} , \frac{u}{\left\|u\right\|} , \frac{v}{\left\|v\right\|}\right)$$
The ordering matters because if you change the orientation, the
rotation will have angle ${-{\pi}}/6$ instead of ${\pi}/6$
A: There is a way to do the rotation of an arbitrary vector $\vec A$ about an arbitrary non-zero vector $\vec V$ by an angle $\theta$ directly without changing basis (at least in an overt way). You only need to use scalar and vector products. First you define the unit vector $\hat u$ along the direction of $\vec V$ by $\hat u = \vec V/|\vec V|$ (the hat represent unit vectors). Then define the parallel and perpendicular parts of $\vec A$ to $\vec V$, $\vec A_{||}$ and $\vec A_{\perp}$ by: 
$$ \vec A_{||} = (\vec A\cdot\hat u)\hat u\,;\qquad\vec A_{\perp}=\vec A-\vec A_{||}\,.$$
If $\vec A_{\perp}=0$ the $\vec A$ does not rotate (it is parallel to $\vec V$). If it is non-zero, then it it easy to see geometrically that the vector $\vec A$ rotates to the vector $\vec B$ given by:
$$\vec B = \vec A_{||} +\vec A_{\perp}\cos(\theta)+\hat u\times\vec A_{\perp}\sin(\theta)\,.$$
To find the rotation matrix you only need to apply this transformation to the unit vectors along the coordinate axis. This formula is very easy to use and to program into a computer. Note that the vectors $\vec V$, $\vec A_{\perp}$ and $ \hat u\times\vec A_{\perp}$ are three mutually orthogonal vectors (not normalized in general).
