0

Find the matrix of the rotation in $\Bbb R^3$ through the angle $\alpha$ around the vector $(1, 2, 3)^T$ . We assume that the rotation is counterclockwise if we sit at the tip of the vector and looking at the origin.

Let $P(\vec x)$ be the linear transformation that rotates the coordinate system such that $z$ axis is in the direction of $(1, 2, 3)^T$, then by using some trignometry,

$P((0,0, 1)^T) = \dfrac1{\sqrt{13}}(1,2,3)^T$, $P((0,1, 0)^T) =(0,\sec \theta,\tan \theta)^T$ and $P((1,0,0)^T) =(\sec \theta,0,\tan \theta)^T$, where $\theta$ is the angle between $(1,2,3)^T$ and $(0,0,1)^T$.

Solving for $\theta$ and using matrix representation of $P$,

$$P(\vec x) = \begin{bmatrix}\dfrac{\sqrt{13}}{3} & 0 &\dfrac1{\sqrt{13}} \\ 0& \dfrac{\sqrt{13}}{3}& \dfrac2{\sqrt{13}} \\\dfrac{-2}{3} & \dfrac{-2}{3}& \dfrac3{\sqrt{13}} \end{bmatrix}\vec x$$

Therefore, I got the final rotation transformation as $T(\vec x) := (P^{-1}\circ R_\alpha \circ P)(\vec x)$, where $$R_\alpha(\vec x) = \begin{bmatrix}\cos \alpha & -\sin \alpha & 0 \\ \sin \alpha & \cos \alpha & 0 \\ 0&0&1\end{bmatrix}.$$

Basically what I did was to rotate the coordinate system with $P$ such that $z$-axis and $(1,2,3)^T$ coincide, then I rotated $xy$-plane by $\alpha$ and then reverted back to original coordinates.

Is this correct ?

Please don't use quaternions or any other voodoo like given here. Please use basic trignometry and linear algebra.

Sorry, normally I don't ask this type of question but I can't verify my results in this case.

user8277998
  • 2,666
  • 1
    it should be a 1 in the last diagonal place. and the corresponding column in $P$ should be the vector in the direction of the axis of rotation. also $P^{-1}$ should be applied first and $P$ last. but everything else looks fine. – mathreadler Oct 06 '17 at 14:13
  • @mathreadler Sorry I incorrectly formatted my matrix. Can you check again ? – user8277998 Oct 06 '17 at 14:17
  • Generally this is problem for appllication of [Rodrigues formula][https://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula]. Hard to say whether it is "voodoo".. – Widawensen Oct 06 '17 at 14:17
  • looks better but you need a 1 in the last diagonal spot instead of a 0 or it will become a projection onto the disc of rotation. – mathreadler Oct 06 '17 at 14:19
  • are you sure you have an ON system by the way? I am not so sure about it... – mathreadler Oct 06 '17 at 14:21
  • @Widawensen Although I think that formula is easy to derive, I don't want to use it. – user8277998 Oct 06 '17 at 14:23
  • @mathreadler What is an ON system ? That $1$ in the last diagonal is a typo – user8277998 Oct 06 '17 at 14:23
  • An ON system is a coordinate system where the basis vectors are pairwise orthogonal to each other. In other words the columns of $P$ should all have scalar product 0 with each other and 1 with themselves. – mathreadler Oct 06 '17 at 14:26
  • @mathreadler It should be an ON system otherwise $P$ won't be invertible right ? – user8277998 Oct 06 '17 at 14:29
  • It can still be invertible as long as the column vectors in $P$ are linearly independent, but the rotation matrix in the middle will not look the same in a non-ON system. – mathreadler Oct 06 '17 at 14:32

1 Answers1

1

You can find $R$ as $PSP^{-1}$ where $P$ is a rotation (orthonormal transformation) that maps the $x$-axis to the axial vector $(1,2,3)$, and $S$ is a rotation of angle $\alpha$ around the $x$-axis.

Finding $S$ is easy: $$S = \begin{bmatrix}1&0&0\\0&\cos\alpha&-\sin\alpha\\0&\sin\alpha&\cos\alpha\end{bmatrix}$$

Finding $P$ is more complex. Firstly, $Pe_1={(1,2,3)^T\over\sqrt{1^2+2^2+3^2}}$. Next, we meed to make sure that $Pe_i \perp Pe_j$ for all $i \neq j$, and $|Pe_1|=|Pe_2|=|Pe_3|=1$; for this we can use the cross product: Make $Pe_2={(1,2,3)^T\times e_1 \over |(1,2,3)^T \times e_1|}$, which is the unit vector perpendicular to $e_1$ and $(1,2,3)^T$, and similarly make $Pe_3 = {((1,2,3)^T\times e_1) \times (1,2,3)^T \over |(((1,2,3)^T\times e_1) \times (1,2,3)^T|}$, which is perpendicular to both $Pe_1$ and $Pe_2$ and of unit length. This satisfies all the conditions we need for $P$.

A remark: A key step in finding $P$ is finding a pair of vectors perpendicular to the axial vector and to each other. There is no continuous mapping that does this because of the hairy ball theorem. In spite of that, there are algorithms for doing this (see Yves Daoust's answer).

wlad
  • 8,185
  • How did you find perpendicular of $(1,2,3)^T$ ? – user8277998 Oct 07 '17 at 15:12
  • @123 $(1,2,3)^T \times (1,0,0)^T = (0,-3,2)^T$ – wlad Oct 07 '17 at 16:53
  • @123 corrected typo – wlad Oct 07 '17 at 16:56
  • Why did you took vector product with $(1,0,0)^T$ not $(0,1,0)^T$ or $(0,0,1)^T$ or something else ? – user8277998 Oct 08 '17 at 15:09
  • @123 Any reason to use something else? See the remark. – wlad Oct 08 '17 at 22:35
  • $Pe_2$ just has to be perpendicular to $Pe_1$ right ? So I can use any of infinitely many perpendicular vectors to $Pe_1$ right ? – user8277998 Oct 09 '17 at 13:39
  • @123 yes because a rotation in 3d is a transformation that preserves an axial vector and rotates the plane perpendicular to the axial vector. Since that plane is perpendicular to the axial vector, $Pe_2$ and $Pe_3$ (which form a basis for that plane) must be perpendicular to $Pe_1$ (which is the axial vector). We furthermore make $Pe_2$ perpendicular to $Pe_3$ because it makes rotating the plane easier. We can use any orthonormal basis we want for the plane. – wlad Oct 09 '17 at 14:18