Are there any slick way of computing the matrix of rotating about a given line passing origin by $\pi$? Let's just consider the lines in $\mathbb{R}^3$. For any line $l$, suppose it is determined by $(x_1:x_2:x_3)$. For any point $(a,b,c)$, after the rotation it is mapped to(as we can compute) $(a',b',c')=(2\lambda x_1-a,2\lambda x_2-b,2\lambda x_3-c)$, where $\lambda=\frac{ax_1+bx_2+cx_3}{x_1^2+x_2^2+x_3^2}$. I computed by using the condition that their middle point is on the line $(x_1:x_2:x_3)$, and $\overline{xx'}$ is orthogonal to the line $l$.
And we can of course compute the matrix of this transformation. But I have trouble checking it indeed satisfies the condition for rotation matrix $\det(A)=1, A^T=A^{-1}$.
I am wondering are their any more algebraic way of finding the matrix? Also, I wish someone could verify whether my answer is correct.
Thanks!

Consider a vector $v=(a,b,c)$ and associate to it the skew matrix
$A$ given by\begin{pmatrix} 
0 & -c & b \\
c & 0 & -a \\
-b & a &0 
\end{pmatrix}
Then $R=e^A$ is rotation about the direction determined by $v$ and angle determined by $\theta=\lVert v\rVert$. Because the powers of $A$ can be computed in terms of $A$, you can find a simple expression for $R$. See here.
