I have this questions and it's really tough for me.
Flat on a plane (with normal N through point P) sits a tank at point Q. The tank's local coordinate system is described by the 3x3 rotation matrix M. How do you update M and Q to make the tank first rotate in-place 45 degrees to its right, followed by moving K units forward? Please express your solution in math, not text. Also explain any assumptions made.
I've been away from using matrix for sometime, any answers or tips on how I should approach this question?
Thank you for the help.
When the tank turns, it does so (presumeably) around the normal to the plane. Since we want to turn in the local coordinate system, so one can think of it as $x_{\text{local}} = M\cdot x_{\text{global}}$ and $x_{\text{local}}' = R\cdot x_{\text{local}}$, where $R$ is the local rotation matrix describing a 45 degree turn.
This leads to the new local coordinate system as \begin{gather} x_{\text{local}}' = R\cdot M\cdot x_{\text{global}}\\ x_{\text{local}}' = M' \cdot x_{\text{global}}\\ M' = R \cdot M \end{gather} where \begin{align} R = \begin{pmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{pmatrix} \end{align} where $\theta = 45^\circ$. Here I chose the local $z$-axis as the normal direction.
When moving forward, it does so in the first axis (if we chose it so) of its local coordinate system, thus \begin{align}Q' = Q + M'\cdot \begin{pmatrix}k & 0 & 0\end{pmatrix}^{\mathrm{T}}\end{align}