TX Ty TZ Ty TZ TX TZ TX Ty Matlab Code:: % Symbolizing The Variables

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Conditions under which TX*TY*TZ = TY*TZ*TX = TZ*TX*TY

Matlab Code:
% Symbolizing the Variables
syms x y z
syms cosx sinx cosy siny cosz sinz
% Transformation Matrices

TX = [ 1 0 0 x;0 cosx -sinx y;0 sinx cosx z;0 0 0 1];


TY = [ cosy 0 siny x;0 1 0 y;-siny 0 cosy z;0 0 0 1];
TZ = [ cosz -sinz 0 x;sinz cosz 0 y;0 0 1 z;0 0 0 1];
A=TX*TY*TZ;
B=TY*TZ*TX;
C=TZ*TX*TY;
% Displaying Matrices
disp('TX')
disp (TX)
disp('TY')
disp (TY)
disp('TZ')
disp (TZ)
disp('TX*TY*TZ')
disp(A)
disp('TY*TZ*TX')
disp(B)
disp('TZ*TX*TY')
disp(C)
disp ('For the Matrices to be equal, the corresponding elements of the
matrices have to be equal')
disp (A==B==C)

Command Window:
TX
[ 1, 0, 0, x]
[ 0, cosx, -sinx, y]
[ 0, sinx, cosx, z]
[ 0, 0, 0, 1]

TY
[ cosy, 0, siny, x]
[ 0, 1, 0, y]
[ -siny, 0, cosy, z]
[ 0, 0, 0, 1]
TZ
[ cosz, -sinz, 0, x]
[ sinz, cosz, 0, y]
[ 0, 0, 1, z]
[ 0, 0, 0, 1]

TX*TY*TZ
[ cosy*cosz, -cosy*sinz, siny,
2*x + cosy*x + siny*z]
[ cosx*sinz + cosz*sinx*siny, cosx*cosz - sinx*siny*sinz, -cosy*sinx,
y + 2*cosx*y - sinx*z - cosy*sinx*z + sinx*siny*x]
[ sinx*sinz - cosx*cosz*siny, cosz*sinx + cosx*siny*sinz, cosx*cosy,
z + cosx*z + 2*sinx*y + cosx*cosy*z - cosx*siny*x]
[ 0, 0, 0,
1]

TY*TZ*TX
[ cosy*cosz, sinx*siny - cosx*cosy*sinz, cosx*siny + cosy*sinx*sinz,
x + cosy*x + 2*siny*z + cosy*cosz*x - cosy*sinz*y]
[ sinz, cosx*cosz, -cosz*sinx,
2*y + cosz*y + sinz*x]
[ -cosz*siny, cosy*sinx + cosx*siny*sinz, cosx*cosy - sinx*siny*sinz,
z + 2*cosy*z - siny*x - cosz*siny*x + siny*sinz*y]
[ 0, 0, 0,
1]

TZ*TX*TY
[ cosy*cosz - sinx*siny*sinz, -cosx*sinz, cosz*siny + cosy*sinx*sinz,
x + 2*cosz*x - sinz*y - cosx*sinz*y + sinx*sinz*z]
[ cosy*sinz + cosz*sinx*siny, cosx*cosz, siny*sinz - cosy*cosz*sinx,
y + cosz*y + 2*sinz*x + cosx*cosz*y - cosz*sinx*z]
[ -cosx*siny, sinx, cosx*cosy,
2*z + cosx*z + sinx*y]
[ 0, 0, 0,
1]

For the Matrices to be equal, the corresponding elements of the


matrices have to be equal
[ (cosy*cosz == cosy*cosz) == cosy*cosz - sinx*siny*sinz,
(-cosy*sinz == sinx*siny - cosx*cosy*sinz) == -cosx*sinz, (siny ==
cosx*siny + cosy*sinx*sinz) == cosz*siny + cosy*sinx*sinz, (2*x +
cosy*x + siny*z == x + cosy*x + 2*siny*z + cosy*cosz*x - cosy*sinz*y)
== x + 2*cosz*x - sinz*y - cosx*sinz*y + sinx*sinz*z]
[ (cosx*sinz + cosz*sinx*siny == sinz) == cosy*sinz + cosz*sinx*siny,
(cosx*cosz - sinx*siny*sinz == cosx*cosz) == cosx*cosz, (-
cosy*sinx == -cosz*sinx) == siny*sinz - cosy*cosz*sinx, (y + 2*cosx*y
- sinx*z - cosy*sinx*z + sinx*siny*x == 2*y + cosz*y + sinz*x) == y +
cosz*y + 2*sinz*x + cosx*cosz*y - cosz*sinx*z]
[ (sinx*sinz - cosx*cosz*siny == -cosz*siny) == -cosx*siny,
(cosz*sinx + cosx*siny*sinz == cosy*sinx + cosx*siny*sinz) == sinx,
(cosx*cosy == cosx*cosy - sinx*siny*sinz) == cosx*cosy, (z + cosx*z +
2*sinx*y + cosx*cosy*z - cosx*siny*x == z + 2*cosy*z - siny*x -
cosz*siny*x + siny*sinz*y) == 2*z + cosx*z + sinx*y]
[ (0 == 0) == 0,
(0 == 0) == 0, (0
== 0) == 0,
(1 == 1) == 1]

Remarks
For the Matrices to be equal, the corresponding elements of the matrices have to be equal. The system
is an underdetermined system with more unknowns the equations.

In some special cases they become equal such as

 If there is no rotation along a minimum of 2 axis then the condition is satisfied


 If the rotation is equal along all of the Axis

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy