Change of basis associated to several successive rotations

215 Views Asked by At

Let us consider vector bases $\mathcal{B_0} = (a,b,c)$, $\mathcal{B_1} = (i,j,k) $ and $\mathcal{B_2} = (x,y,z)$ in $\mathbb{R}^3$, such that :

  • $\mathcal{B_1}$ is obtained by applying a rotation, defined by the matrix $R_1$, to $\mathcal{B_0}$
  • $\mathcal{B_2}$ is obtained by applying a rotation, defined by the matrix $R_2$, to $\mathcal{B_1}$

So we have :

  • $i = R_1 a$, $j = R_1 b$ and $k = R_1 c$
  • $x = R_2 i = R_2 R_1 a$, $y = R_2 j = R_2 R_1 b$ and $z = R_2 k = R_2 R_1 c$

Thus, the two successive rotations can be directly described by just one matrix $R_3 = R_2 R_1$.

Now, introduce a vector $\mathbf{v}$, expressed as $\mathbf{v}_0$ in $\mathcal{B_0}$, $\mathbf{v}_1$ in $\mathcal{B_1}$ and $\mathbf{v}_2$ in $\mathcal{B_2}$.

By definition of a rotation matrix, the changes of basis from $\mathcal{B_0}$ to $\mathcal{B_1}$, and from $\mathcal{B_1}$ to $\mathcal{B_2}$ are expressed as :

  • $v_0 = R_1 v_1$
  • $v_1 = R_2 v_2$

So we have : $v_0 = R_1 R_2 v_2 = P_0^2 v_ 2$, where $P_0^2$ allows to change from basis $\mathcal{B_2}$ to basis $\mathcal{B_1}$.

So, if we take $v = x$, we have $x_2 = [1, 0, 0]^T$ and $x_0 = R_2 R_1 a_0$.

Since $a_0 = [1, 0, 0]^T = x_2$ $\implies$ $x_0 = R_2 R_1 x_2$ which is (obviously) different from $x_0 = R_1 R_2 x_2$

By definition of a rotation matrix, we should have $P_0^2 = R_3$, as for Euler angles rotation matrix. However the last line implies $P_0^2 \neq R_3$ as matrix product is not commutative. So where is the problem in my development ? Is it just that we do not compose change of basis like rotations ?

3

There are 3 best solutions below

14
On BEST ANSWER

Let's look at a general problem: we have a basis $\mathcal{B}_0$ and a basis $\mathcal{B}_1$ and we want to get the coordinate matrix of the transformation $[\mathrm{Id}]_{1}^{0}$, so the transformation that takes coordinate vectors in $\mathcal{B}_0$ and takes it to $\mathcal{B}_1$. Let $x_i,y_i$ be the basis vectors of $\mathcal{B}_0,\mathcal{B}_1$ and suppose $P$ is a linear transformation such that $Px_i=y_i$. Let $[v]_{0/1}$ denote the coordinate vector of $v$ in $\mathcal{B}_{0/1}$ respectively.

Now let's define $[P]_0^0$ by saying that it takes $[v]_0$ to $[Pv]_0$ - this is achieved by setting the columns of $[P]_0^0$ to be $[Px_i]_0=[y_i]_0$. Therefore, this matrix takes $[y_i]_1$ to $[Px_i]_0=[y_i]_0$ so in fact $[P]_0^0=[\mathrm{Id}]_{0}^{1}=([\mathrm{Id}]_{1}^{0})^{-1}$.

In your case $P$ is a rotation. I think that basically the problem is that you never defined in which bases you're looking at $R_1$, $R_2$: are we talking $[R_1]^0_0$ or $[R_1]^1_1$ or $[R_1]_2^0$ or what? And the answer then depends. I presume you meant $[R_1]_0^0$ and $[R_2]_1^1$, in which case $$ [x]_0=[\mathrm{Id}]_{0}^{1}[\mathrm{Id}]_{1}^{2}[x]_2=[R_1]_0^0[R_2]_1^1[x]_2 $$ and also $$ [x]_2=[a]_0=[R_1^{-1}]_0^0[R_2^{-1}]_0^0[x]_0=([R_1]^0_0){-1}[\mathrm{Id}]_{0}^{1}[R_2^{-1}]_1^1[\mathrm{Id}]_{1}^{0}[x]_0=([R_1]^0_0)^{-1}[R_1]^0_0[R_2^{-1}]_1^1([R_1]^0_0)^{-1}[x]_0=([R_2]_1^1)^{-1}([R_1]^0_0)^{-1}[x]_0 $$ so again $$ [x]_0=[R_1]_0^0[R_2]_1^1[x]_2 $$ and there is no contradiction.

So, to recap: $[R_2]_1^1$ has as columns the coordinate expressions of $\mathcal{B}_2$ in $\mathcal{B}_1$ and $[R_1]_0^0$ has as columns the coordinate expressions of $\mathcal{B}_1$ in $\mathcal{B}_0$. Therefore, applying $[R_2]_1^1$ to $[x]_2$ gives the expression of $x$ in $\mathcal{B}_1$ and then applying $[R_1]_0^0$ to $[x]_1$ gives the expression of $x$ in $\mathcal{B}_0$

I think you approach this pretty much in anyway, though, as long as you keep a sharp distinction between a linear transformation and a matrix and make sure you always know what exact coordinate matrix your linear transformation has and in which basis you've decided to express it.

EDIT: eyeballfrog's answer says that the correct way is $v_0=R_2R_1v_2$. You also said in your question that obviously, $R_2R_1\neq R_1R_2$. So the answers we provided seem inconsistent. However, consider that both $$ [x]_0=[R_1]_0^0[R_2]_1^1[x]_2 $$ and $$ [x]_0=[R_2]_0^0[R_1]_0^0[x]_2 $$ In fact, $[R_1]_0^0[R_2]_1^1=[R_2]_0^0[R_1]_0^0$, so if you don't use coordinate transformations carefully, it looks like we would have $R_1R_2=R_2R_1$ - however, if we use the $[\cdot]$ notation, the confusion disappears as the $R$'s represent rotations in different bases. So in fact both answers are correct, it just amounts to different coordinate expressions.

EDIT: Also, what about defining $R_3=R_2R_1$, is everything still consistent? Well, since $R_3$ takes $\mathcal{B}_0$ to $\mathcal{B}_2$, we have $[R_3]_0^0=[\mathrm{Id}]_0^2=[\mathrm{Id}]_0^1[\mathrm{Id}]_1^2=[R_1]_0^0[R_2]_1^1$. It looks like $R_1$ and $R_2$ have flipped - but this is actually just what needs to happen. Indeed, we already know the first equality in the following line: $$ [R_1]_0^0[R_2]_1^1=[R_2]_0^0[R_1]_0^0=[R_2R_1]_0^0=[R_3]_0^0 $$ as required.

11
On

The problem is here $$ v_0 = R_1 v_1\\ v_1 = R_2 v_2 $$

$R_1$ as a matrix is expressed in terms of basis $\mathcal B_0$, while $R_2$ as a matrix is expressed in basis $\mathcal B_1$. In order to use matrix multiplication to do this problem, they need to be expressed in the same basis. The rotation $R_2$ expressed as a matrix in basis $\mathcal B_0$ is $R_1^{-1}R_2R_1$. So instead of $v_0 = R_1 R_2 v_2$, you get $$ v_0 = R_1(R_1^{-1}R_2R_1)v_2 = R_2 R_1 v_2 $$ and there is no contradiction.

0
On

In order to illustrate the answers, I made a small Matlab code corresponding to the three successive rotations corresponding to the classical Euler angles (precession, nutation and intrinsic rotation). It shows clearly the link between the active and passive transformations.

Illustration

% ---------------- First rotation: Precession around Oc axis 

a_0 = [1,0,0]';
b_0 = [0,1,0]';
c_0 = [0,0,1]';

R1_00 = rotmat(20*pi/180,c_0); % 

% ---------------- Second rotation: Nutation around Oi axis

i_0 = R1_00*a_0;
j_0 = R1_00*b_0;
k_0 = R1_00*c_0;

R2_00 = rotmat(40*pi/180,i_0);      
R2_11 = rotmat(40*pi/180,[1,0,0]');

% Comparison (they are equals)
R2_00
[R2_00*a_0 R2_00*b_0 R2_00*c_0]
R1_00*R2_11*inv(R1_00)

% ---------------- Third rotation: % Intrinsic rotation around 0z axis
% Basis 2
x_0 = R2_00*i_0;
y_0 = R2_00*j_0;
z_0 = R2_00*k_0;

R3_00 = rotmat(15*pi/180,z_0) 
R3_22 = rotmat(15*pi/180,[0,0,1]')

% Comparison (they are equals)
R3_00
[R3_00*a_0 R3_00*b_0 R3_00*c_0]
R1_00*(R2_11*R3_22*inv(R2_11))*inv(R1_00)

% Basis 3 from successive rotation (active transformation)
e_0 = R3_00*x_0;
f_0 = R3_00*y_0;
g_0 = R3_00*z_0;

% Basis 3 from successive change of basis (passive transformation)
e_0_bis = R1_00*R2_11*R3_22*a_0;
f_0_bis = R1_00*R2_11*R3_22*b_0;
g_0_bis = R1_00*R2_11*R3_22*c_0;

% Comparison (their are equals)
[e_0 e_0_bis]
[f_0 f_0_bis]
[g_0 g_0_bis]

Rotation matrix function 'rotmat'

function R = rotmat(theta,u)
u_x = u(1);
u_y = u(2);
u_z = u(3);

R = [cos(theta) + (u_x^2)*(1 - cos(theta)), u_x*u_y*(1-cos(theta))-u_z*sin(theta), u_x*u_z*(1-cos(theta)) + u_y*sin(theta);
     u_y*u_x*(1-cos(theta))+u_z*sin(theta),cos(theta) + (u_y^2)*(1 - cos(theta)), u_y*u_z*(1-cos(theta)) - u_x*sin(theta);
     u_z*u_x*(1-cos(theta))-u_y*sin(theta), u_z*u_y*(1-cos(theta))+u_x*sin(theta), cos(theta) + (u_z^2)*(1 - cos(theta))];
end

So, to conclude on this question, it is of crucial importance to be careful about the meaning of each matrix and the basis in which it is defined.