2
$\begingroup$

Suppose that I am given a vector $(a,b,c) \in R^3$, and I want to calculate the representation matrix of the rotation of $180$ degrees around this vector. My attempt is to geometrically find out the coordinate of the standard basis after rotation. Using dot product, I can find out the angle between $e_1 = (1,0,0)$ and $(a,b,c)$. Then suppose $e_1$ is rotated to $a_1$. I now have three equations for $a_1$, namely the angle between $a_1$ and $(a,b,c)$, then length of $a_1$ and $a_1-e_1$ is orthogonal to $(a,b,c)$. However this turns out to be hard to calculate, is there any simpler method?

$\endgroup$
2
$\begingroup$

In the general case, there's an axis-and-angle formula for rotation matrices.

In your particular case of rotating through $\pi$, though, there's a simpler solution.

To rotate a vector $x$, consider the components of the rotated vector $x'$ along $v=(a,b,c)$ and perpendicular to it. The parallel component is unchanged and the perpendicular component is reversed. Thus

$$ x'=x_\parallel-x_\perp=\frac{vv^\top x}{v^\top v}-\left(x-\frac{vv^\top x}{v^\top v}\right)=2\frac{vv^\top x}{v^\top v}-x\;, $$

so the desired matrix is

$$ 2\frac{vv^\top}{v^\top v}-I\;. $$

$\endgroup$
  • $\begingroup$ But shouldn't the first term be $2 \frac{v^Tx}{\sqrt{v^Tv}}x$? $\endgroup$ – Keith Mar 25 '16 at 14:35
  • $\begingroup$ @Keith: No. Apart from normalisation problems, that's a vector along $x$; the parallel component is supposed to be the component of $x$ along $v$, not the component of $v$ along $x$. $\endgroup$ – joriki Mar 25 '16 at 14:40
  • $\begingroup$ I see my problem, thanks. $\endgroup$ – Keith Mar 25 '16 at 14:43
2
$\begingroup$

Given the vector $\mathbf{v}=(a,b,c)^T$ you can normalize it to $$\mathbf{u}=\frac{\mathbf{v}}{|\mathbf{v}|}$$ than use a matrix to represent the rotation, as you can see here.

Another useful way to represent rotations in 3D is using quaternions. In such representation a rotation of an angle $2\theta$ in space, around an axis passing through the origin, is represented by a quaternion $e^{\mathbf{u}\theta}$, where $\mathbf{u}$ is the imaginary quaternion that correspond to the unit vector oriented along the axis of rotation. So we have the correspondence: $$ \vec{w}=R_{\mathbf{u},\theta} \; \vec{v} \quad \longleftrightarrow \quad \mathbf{w}= e^{\mathbf{u}\theta/2}\mathbf{v}e^{-\mathbf{u}\theta/2} $$

( see Quaternions vs Axis angle)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.